eval.in

Paste #64737

PHP — PHP 5.5.1, pasted 5 months ago

1
2
3
4
5
6
7
8
9
<?php
$foo = "hello";

$foo[0] = $foo[0] + 1;
var_dump($foo);

$foo[0]++;
var_dump($foo);
?>

Program Output

string(5) "1ello"

Fatal error: Cannot increment/decrement overloaded objects nor string offsets in /tmp/execpad-70cfe44d5cff/source-70cfe44d5cff on line 7

Exited with error status 255

Fork