3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(PHP_INT_MAX); function explodeTrim($delimiter, $string, $limit = PHP_INT_MAX) { return explode($delimiter, $string, $limit); } $emails = 'test1@example.com, test2@example.com'; var_dump(explodeTrim(',', $emails)); // using default limit=PHP_INT_MAX var_dump(explodeTrim(',', $emails, 0x7FFFFFFF)); var_dump(explode(',', $emails));
based on 5q7IG
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.1
int(9223372036854775807) array(2) { [0]=> string(17) "test1@example.com" [1]=> string(18) " test2@example.com" } array(2) { [0]=> string(17) "test1@example.com" [1]=> string(18) " test2@example.com" } array(2) { [0]=> string(17) "test1@example.com" [1]=> string(18) " test2@example.com" }
Output for hhvm-3.12.14 - 3.17.3
int(9223372036854775807) array(1) { [0]=> string(17) "test1@example.com" } array(2) { [0]=> string(17) "test1@example.com" [1]=> string(18) " test2@example.com" } array(2) { [0]=> string(17) "test1@example.com" [1]=> string(18) " test2@example.com" }