3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = "2017 MODEL YEAR 6.7L POWER STROKE V8 DIESEL 6-SPEED AUTO TRANS 3.55 ELECTRONIC LOCKING AXLE FX4 OFF-ROAD PACKAGE .SKID PLATES 10000-lb. GVWR 20000-lb PACKAGE"; Preg_match("/(\d+)(\d{3})-lb/ui", $string, $match); $find = $match[0]; $replace = $match[1] .",". $match[2] ."-lb"; Echo length($match); Echo str_replace($find, $replace, $string);
based on WdlMP
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught Error: Call to undefined function length() in /in/uNZB6:10 Stack trace: #0 {main} thrown in /in/uNZB6 on line 10
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught Error: Call to undefined function length() in /in/uNZB6:-1 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught Error: Call to undefined function length() in /in/uNZB6:10 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function length() in /in/uNZB6 on line 10
Process exited with code 255.