3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $valor = array ( "invoice"=> 34843, "date"=> 980208000, "bill-to"=> 'mu', "ship-to"=> 'kikiriki', "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 ZWLgG
Output for 7.0.0 - 7.2.0
array(8) { ["invoice"]=> int(34843) ["date"]=> int(980208000) ["bill-to"]=> string(2) "mu" ["ship-to"]=> string(8) "kikiriki" ["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/ZIsdS:27 Stack trace: #0 {main} thrown in /in/ZIsdS on line 27
Process exited with code 255.
Output for 5.3.21 - 5.6.28
array(8) { ["invoice"]=> int(34843) ["date"]=> int(980208000) ["bill-to"]=> string(2) "mu" ["ship-to"]=> string(8) "kikiriki" ["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/ZIsdS on line 27
Process exited with code 255.