3v4l.org

run code in 200+ php & hhvm versions
<?php $tests = ['1,23,45,123,145,200', '345,999,0,1', '0', '0,2', '-1,-122', '', '1.5,2.9']; foreach ($tests as $test) { $before_comma = strstr($test, ',', true); var_export($before_comma === false ? $test : $before_comma); echo "\n"; }
based on tR1jG
Output for 7.1.25 - 7.3.1
'1' '345' '0' '0' '-1' '' '1.5'