3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response = json_encode([ "success" => true, "quoteId" => 11, "abcValue" => 0, "priceResponse" => [ [ "priceId" => 1263, "fPrice" => 37.14, "grossPrice" => 44.7, "priceType" => "ABC", ], [ "priceId" => 1263, "fPrice" => 37.14, "grossPrice" => 44.7, "priceType" => "ABC", ], [ "priceId" => 1266, "fPrice" => 550.14, "grossPrice" => 544.7, "priceType" => "DEF", ], ], ]); $object = json_decode($response); $object = (object)[ 'success' => $object->success, 'quoteId' => $object->quoteId, 'priceResponse' => array_map( fn($item) => [ 'priceId' => $item->priceId, 'customPrice' => $item->grossPrice * 1.1, ], $object->priceResponse ) ]; print_r($object);
Output for 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.4.16, 8.5.0 - 8.5.1
stdClass Object ( [success] => 1 [quoteId] => 11 [priceResponse] => Array ( [0] => Array ( [priceId] => 1263 [customPrice] => 49.17 ) [1] => Array ( [priceId] => 1263 [customPrice] => 49.17 ) [2] => Array ( [priceId] => 1266 [customPrice] => 599.17 ) ) )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
87.06 ms | 408 KiB | 5 Q