3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'ticket_number' => 'sdfsdfsdf 2', 'strategy_id' => '5', 'journal_entries_strategy_conditions' => [ 0 => [ 'strategies_condition_id' => '' ], 1 => [ 'strategies_condition_id' => '1' ] ], 'timeframe' => '', ]; foreach ($array['journal_entries_strategy_conditions'] as $i => $row) { if (!$row['strategies_condition_id']) { array_splice($array['journal_entries_strategy_conditions'], $i, 1); } } var_export($array);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
array ( 'ticket_number' => 'sdfsdfsdf 2', 'strategy_id' => '5', 'journal_entries_strategy_conditions' => array ( 0 => array ( 'strategies_condition_id' => '1', ), ), 'timeframe' => '', )

preferences:
99.78 ms | 402 KiB | 91 Q