3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = '{"data":"key=IAfpK, age=58, key=WNVdi, age=64, key=jp9zt, age=47"}'; preg_match_all('/(?:age=)([0-9]+)/', json_decode($data)->data, $matches, PREG_PATTERN_ORDER); if (array_key_exists(1, $matches)) { $greaterThan50 = array_filter($matches[1], function($age) { return intval($age) > 50; }); var_dump($greaterThan50); }
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.7
array(2) { [0]=> string(2) "58" [1]=> string(2) "64" }

preferences:
91.06 ms | 1127 KiB | 5 Q