3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr=[ 11=>[ "a"=>"Blaa", "b"=>"Inco", ], 12=>[ "a"=>"XXX", "b"=> new stdClass(), ] ]; print_r(array_column($arr ?? [],null,"b"));
Output for 8.2.0 - 8.2.34
Fatal error: Uncaught TypeError: Illegal offset type in /in/GZi8D:4 Stack trace: #0 /in/GZi8D(4): array_column(Array, NULL, 'b') #1 {main} thrown in /in/GZi8D on line 4
Process exited with code 255.
Output for 8.3.0 - 8.3.35, 8.4.1 - 8.4.26, 8.5.0 - 8.5.11
Fatal error: Uncaught TypeError: Cannot access offset of type stdClass on array in /in/GZi8D:4 Stack trace: #0 /in/GZi8D(4): array_column(Array, NULL, 'b') #1 {main} thrown in /in/GZi8D on line 4
Process exited with code 255.

preferences:
33.93 ms | 1155 KiB | 9 Q