3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ [ 'lang' => 'de', 'value' => "text_1_en_Text i need", 'id' => 2365 ], [ 'lang' => 'en', 'value' => "something i dont need", 'id' => 2365 ] ]; $needle = 'text_1_en_'; var_export( array_filter( $array, fn($row) => str_starts_with($row['value'], $needle) ) ); echo "\n---\n"; $result = []; foreach ($array as $row) { if (str_starts_with($row['value'], $needle)) { $result = $row; break; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'lang' => 'de', 'value' => 'text_1_en_Text i need', 'id' => 2365, ), ) --- array ( 'lang' => 'de', 'value' => 'text_1_en_Text i need', 'id' => 2365, )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
44.66 ms | 1285 KiB | 4 Q