3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $valor = array ( "invoice"=> 34843, "date"=> 980208000, "bill-to"=> $addr, "ship-to"=> $addr, "product"=> array( array( "sku"=> "BL394D", "quantity"=> 4, "description"=> "Basketball", "price"=> 450, ), array( "sku"=> "BL4438H", "quantity"=> 1, "description"=> "Super Hoop", "price"=> 2392, ), ), "tax"=> 251.42, "total"=> 4443.52, "comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.", ); var_dump($valor); $valoryml = yaml_emit($valor); var_dump($valoryml);
based on DMetA
Output for 7.0.0 - 7.2.0
Notice: Undefined variable: addr in /in/ZWLgG on line 5 Notice: Undefined variable: addr in /in/ZWLgG on line 6 array(8) { ["invoice"]=> int(34843) ["date"]=> int(980208000) ["bill-to"]=> NULL ["ship-to"]=> NULL ["product"]=> array(2) { [0]=> array(4) { ["sku"]=> string(6) "BL394D" ["quantity"]=> int(4) ["description"]=> string(10) "Basketball" ["price"]=> int(450) } [1]=> array(4) { ["sku"]=> string(7) "BL4438H" ["quantity"]=> int(1) ["description"]=> string(10) "Super Hoop" ["price"]=> int(2392) } } ["tax"]=> float(251.42) ["total"]=> float(4443.52) ["comments"]=> string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338." } Fatal error: Uncaught Error: Call to undefined function yaml_emit() in /in/ZWLgG:27 Stack trace: #0 {main} thrown in /in/ZWLgG on line 27
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Notice: Undefined variable: addr in /in/ZWLgG on line 5 Notice: Undefined variable: addr in /in/ZWLgG on line 6 array(8) { ["invoice"]=> int(34843) ["date"]=> int(980208000) ["bill-to"]=> NULL ["ship-to"]=> NULL ["product"]=> array(2) { [0]=> array(4) { ["sku"]=> string(6) "BL394D" ["quantity"]=> int(4) ["description"]=> string(10) "Basketball" ["price"]=> int(450) } [1]=> array(4) { ["sku"]=> string(7) "BL4438H" ["quantity"]=> int(1) ["description"]=> string(10) "Super Hoop" ["price"]=> int(2392) } } ["tax"]=> float(251.42) ["total"]=> float(4443.52) ["comments"]=> string(68) "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338." } Fatal error: Call to undefined function yaml_emit() in /in/ZWLgG on line 27
Process exited with code 255.