3v4l.org

run code in 300+ PHP versions simultaneously
<?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.4.0
Static Var 389504 389504 Dynamic Var 389504 389504 390528 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 7.3.0 - 7.3.12
Static Var 389448 389448 Dynamic Var 389448 389448 390472 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 7.2.17 - 7.2.25
Static Var 385392 385392 Dynamic Var 385392 385392 386416 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 7.2.0
Static Var 385432 385432 Dynamic Var 385432 385432 386456 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 7.1.26 - 7.1.33
Static Var 348784 348784 Dynamic Var 348784 348784 349808 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 7.0.0 - 7.0.20, 7.1.0, 7.1.7
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 7.1.5 - 7.1.6
Static Var 349272 349272 Dynamic Var 349272 349272 350296 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 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.0.5, 5.1.0 - 5.1.6, 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.3.11, 4.4.0 - 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.

preferences:
169.15 ms | 401 KiB | 247 Q