3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $text = 'Content-Type: text/xml'; print substr($text, strchr($text, ':')); print substr($text, strchr($text, ':') + 1); print substr($text, strpos($text, ':') + 1); print substr($text, strpos($text, ':') + 2); print substr($text, 0, strchr($text, ':'));
based on lZRIW
Output for 7.3.0alpha1 - 7.3.0beta1
Warning: substr() expects parameter 2 to be int, string given in /in/TF9f1 on line 4 Warning: A non-numeric value encountered in /in/TF9f1 on line 5 ontent-Type: text/xml text/xmltext/xml Warning: substr() expects parameter 3 to be int, string given in /in/TF9f1 on line 8
Output for 7.1.0 - 7.2.6
Warning: substr() expects parameter 2 to be integer, string given in /in/TF9f1 on line 4 Warning: A non-numeric value encountered in /in/TF9f1 on line 5 ontent-Type: text/xml text/xmltext/xml Warning: substr() expects parameter 3 to be integer, string given in /in/TF9f1 on line 8
Output for hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.0.20
Warning: substr() expects parameter 2 to be integer, string given in /in/TF9f1 on line 4 ontent-Type: text/xml text/xmltext/xml Warning: substr() expects parameter 3 to be integer, string given in /in/TF9f1 on line 8
Output for 5.6.0 - 5.6.30
Warning: substr() expects parameter 2 to be long, string given in /in/TF9f1 on line 4 ontent-Type: text/xml text/xmltext/xml Warning: substr() expects parameter 3 to be long, string given in /in/TF9f1 on line 8