3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tracking = '1Z0ER5190360727519'; if(count(preg_match("/\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\dT]\d\d\d ?\d\d\d\d ?\d\d\d)\b/i", $tracking))==1){print "UPS";} if(count(preg_match("/\b((96\d\d\d\d\d ?\d\d\d\d|96\d\d) ?\d\d\d\d ?d\d\d\d( ?\d\d\d)?)\b/i", $tracking))==1){print "FedEx";} if(count(preg_match("/\b(91\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d|91\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d ?\d\d\d\d)\b/i", $tracking))==1){print "FedEx";} var_dump(preg_match("/\b((96\d\d\d\d\d ?\d\d\d\d|96\d\d) ?\d\d\d\d ?d\d\d\d( ?\d\d\d)?)\b/i", $tracking));
Output for 7.2.0
Warning: count(): Parameter must be an array or an object that implements Countable in /in/O1mar on line 3 UPS Warning: count(): Parameter must be an array or an object that implements Countable in /in/O1mar on line 4 FedEx Warning: count(): Parameter must be an array or an object that implements Countable in /in/O1mar on line 5 FedExint(0)
Output for 4.3.0 - 7.1.10
UPSFedExFedExint(0)