3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isValidObject($object) { if ($applicant = $object->getApplicant()) { if ($generalData = $applicant->getGeneralData()) { if ($identifications = $generalData->getIdentifications()) { if ((int)$identifications->getIdentificationCode() > 1) { return TRUE; } } } } return FALSE; } function isValidObjectShort($object) { return (int)($object?->getApplicant()?->getGeneralData()?->getIdentifications()?->getIdentificationCode()) > 1; }
Output for 8.1.23 - 8.1.34, 8.2.10 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Output for 7.1.0 - 7.1.13, 7.2.0 - 7.2.1
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /in/0Y8j8 on line 18
Process exited with code 255.

preferences:
68.67 ms | 902 KiB | 4 Q