3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function p($x) { echo "x"; if (x<= 2) { return 2; } else { return p(x-1)+p(x-2) -1; } } var_dump(p(p(5)));
based on eqL0l
Output for 7.2.0
x Warning: Use of undefined constant x - assumed 'x' (this will throw an Error in a future version of PHP) in /in/LClUW on line 5 x Warning: Use of undefined constant x - assumed 'x' (this will throw an Error in a future version of PHP) in /in/LClUW on line 5 int(2)
Output for 5.3.19 - 7.1.10
x Notice: Use of undefined constant x - assumed 'x' in /in/LClUW on line 5 x Notice: Use of undefined constant x - assumed 'x' in /in/LClUW on line 5 int(2)