3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data['frequency'] = 0; $data['amount'] = 0; $data['custom-amount'] = 3.00; $charge = (function() use ($data) { if( $data['frequency']< 1 ) { if($data['amount'] == "0") { return $data['custom-amount']; }else { return $data['amount']; } }else { return "0.00"; } }); echo $charge;
based on Z2lGL
Output for 7.1.0 - 7.2.0
Recoverable fatal error: Object of class Closure could not be converted to string in /in/amfE0 on line 20
Process exited with code 255.
Output for 5.3.21 - 7.0.20
Catchable fatal error: Object of class Closure could not be converted to string in /in/amfE0 on line 20
Process exited with code 255.