3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function calc_string($string) { $calc = create_function("", "return (" . preg_replace('[^0-9\+-\*\/\(\) ]', '', trim($string)) . ");" ); return $calc(); } echo calc_string("6 * ((26 / 2) + -3) - 20");
Output for 7.2.0
Deprecated: Function create_function() is deprecated in /in/mluF9 on line 4 40
Output for 4.3.0 - 7.1.10
40