3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php const STATUS_SUCCESS = 'success'; const STATUS_FAILED = 'failed'; const STATUS_PENDING = 'pending'; const STATUS_CHARGEBACK = 'chargeback'; const STATUS_CANCELED = 'canceled'; $status = 'sdfasdf'; switch ($status) { case STATUS_FAILED: case STATUS_CANCELED: case STATUS_CHARGEBACK: var_dump('asdfasdf'); break; case STATUS_PENDING: case STATUS_SUCCESS: var_dump('dsfgdf'); break; default: throw new \InvalidArgumentException(sprintf("Unknown transaction response status: '%s'", $status)); break; }
based on IttIi
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught InvalidArgumentException: Unknown transaction response status: 'sdfasdf' in /in/NmC8K:22 Stack trace: #0 {main} thrown in /in/NmC8K on line 22
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Unknown transaction response status: 'sdfasdf'' in /in/NmC8K:22 Stack trace: #0 {main} thrown in /in/NmC8K on line 22
Process exited with code 255.