3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array("php", 4.0, array("green", "red")); $input2 = $input; // add ref count $ar = &$input2[0]; print_r($input2); $ar = 100; print_r($input2); $b = "bbbbbbb"; $ar = &b; print_r($input2); /* $reversed = array_reverse($input); $preserved = array_reverse($input, true); print_r($input); print_r($reversed); print_r($preserved); */
Output for 7.0.0
Parse error: syntax error, unexpected ';', expecting '[' in /in/4siAQ on line 10
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected ';', expecting '(' in /in/4siAQ on line 10
Process exited with code 255.

preferences:
176.04 ms | 1395 KiB | 24 Q