3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = "foo"; var_dump($a[7] = "abc"); $a[10] += 1; var_dump($a);
based on bGaTR
Output for 7.1.0
string(1) "a" Fatal error: Uncaught Error: Cannot use assign-op operators with string offsets in /in/PmHUQ:4 Stack trace: #0 {main} thrown in /in/PmHUQ on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.14
string(1) "a" Fatal error: Uncaught Error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/PmHUQ:4 Stack trace: #0 {main} thrown in /in/PmHUQ on line 4
Process exited with code 255.
Output for 5.2.6 - 5.2.9, 5.2.12 - 5.6.28, hhvm-3.10.0 - 3.12.0
string(1) "a" Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/PmHUQ on line 4
Process exited with code 255.
Output for 5.2.10 - 5.2.11
Notice: Uninitialized string offset: 7 in /in/PmHUQ on line 3 string(1) "a" Notice: Uninitialized string offset: 10 in /in/PmHUQ on line 4 Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/PmHUQ on line 4
Process exited with code 255.
Output for 4.3.3 - 5.2.5
string(3) "abc" Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/PmHUQ on line 4
Process exited with code 255.
Output for 4.3.2
NULL Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/PmHUQ on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
NULL Fatal error: Cannot use assign-op operators with overloaded objects nor string offsets in /in/PmHUQ on line 4