3v4l.org

run code in 300+ PHP versions simultaneously
<?php $events = [ [ 'categoryId' => 1, 'eventId' => 2, 'eventName' => 3, 'vendorName' => 4 ], [ 'categoryId' => 5, 'eventId' => 6, 'eventName' => 7, 'vendorName' => 8 ], [ 'categoryId' => 9, 'eventId' => 10, 'eventName' => 11, 'vendorName' => 12 ], ]; print_r(array_column($events, 'categoryId'));
Output for 5.6.0 - 5.6.27, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
Array ( [0] => 1 [1] => 5 [2] => 9 )

preferences:
77.72 ms | 407 KiB | 5 Q