3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array( array( 'targeted' => array( 'plm1' => "1", 'plm2' => "2", 'plm3' => "3", ), 'plm1' => "4", 'plm3' => "5", 'plm4' => "6", ), array( 'plm1' => "2", 'plm3' => "3", 'plm4' => "4", ), ); print_r(array_column(array_reduce($a, "targeted"), "plm1"));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: array_reduce(): Argument #2 ($callback) must be a valid callback, function "targeted" not found or invalid function name in /in/FLBjW:21 Stack trace: #0 /in/FLBjW(21): array_reduce(Array, 'targeted') #1 {main} thrown in /in/FLBjW on line 21
Process exited with code 255.
Output for 5.6.38, 7.0.0 - 7.0.32, 7.1.0 - 7.1.24, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
Warning: array_reduce() expects parameter 2 to be a valid callback, function 'targeted' not found or invalid function name in /in/FLBjW on line 21 Warning: array_column() expects parameter 1 to be array, null given in /in/FLBjW on line 21

preferences:
172.24 ms | 403 KiB | 213 Q