3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Tracking { public __construct($client) { } function generateID($length) { $id = $client; $x = 0; while ($x < $length) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789'; $id .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); } return $id; } } $parcel = new Tracking(1426); echo $parcel->generateID(20);
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '__construct' (T_STRING), expecting variable (T_VARIABLE) in /in/o64gg on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/o64gg on line 5
Process exited with code 255.

preferences:
183.74 ms | 1395 KiB | 62 Q