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'));

preferences:
23.96 ms | 405 KiB | 5 Q