3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = "foobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisoutfoobarbizbazbuztestingthisout"; $b = str_repeat("a", 300); echo "Static Var\n"; testCopy($a); echo "Dynamic Var\n"; testCopy($b); $c = $a . "test"; echo memory_get_usage() . "\n"; $c = clone $c; echo memory_get_usage() . "\n"; function testCopy($var) { echo memory_get_usage() . "\n"; $var = (string) $var; echo memory_get_usage() . "\n"; }
Output for 7.0.0 - 7.1.0
Static Var 348856 348856 Dynamic Var 348856 348856 349880 Fatal error: Uncaught Error: __clone method called on non-object in /in/AJshL:11 Stack trace: #0 {main} thrown in /in/AJshL on line 11
Process exited with code 255.
Output for hhvm-3.12.0
Static Var 2097152 2097152 Dynamic Var 2097152 2097152 2097152 Fatal error: Uncaught Error: clone called on non-object in /in/AJshL:11 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Static Var 2097152 2097152 Dynamic Var 2097152 2097152 2097152 Fatal error: clone called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Static Var 220368 220416 Dynamic Var 220368 220736 221400 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Static Var 220352 220400 Dynamic Var 220352 220720 221384 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.4.0 - 5.4.45
Static Var 220872 220920 Dynamic Var 220872 221240 221904 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.3.11 - 5.3.29
Static Var 625880 626816 Dynamic Var 625880 626248 626920 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.3.0 - 5.3.10
Static Var 625576 626512 Dynamic Var 625576 625944 626616 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.2.10 - 5.2.17
Static Var 83824 84752 Dynamic Var 83824 84184 84760 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.2.7 - 5.2.9
Static Var 84424 85408 Dynamic Var 84520 84840 85736 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.2.5 - 5.2.6
Static Var 84744 85728 Dynamic Var 84840 85160 86056 Fatal error: __clone method called on non-object in /in/AJshL on line 11
Process exited with code 255.
Output for 5.2.3 - 5.2.4
Static Var 84744 85728 Dynamic Var 84840 85160 86056 Warning: __clone method called on non-object in /in/AJshL on line 11 85256
Output for 5.2.2
Static Var 82640 83624 Dynamic Var 82736 83056 83952 Warning: __clone method called on non-object in /in/AJshL on line 11 83152
Output for 5.2.1
Static Var 82688 83576 Dynamic Var 82728 83048 83624 Warning: __clone method called on non-object in /in/AJshL on line 11 82920
Output for 5.0.0 - 5.2.0
Static Var Fatal error: Call to undefined function memory_get_usage() in /in/AJshL on line 15
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/AJshL on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_VARIABLE in /in/AJshL on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/AJshL on line 11
Process exited with code 255.