3v4l.org

run code in 300+ PHP versions simultaneously
<?php function codePoints($utf8_str){ //入力をUTF-32に変換 $utf32_str=mb_convert_encoding($utf8_str,'UTF-32','UTF-8'); for($i=0;$i<mb_strlen($utf32_str,'UTF-32');++$i) //1文字ずつ16進文字列に変換 $result[]=bin2hex(mb_substr($utf32_str,$i,1,'UTF-32')); return $result; } //mb_internal_encoding('UTF-8'); $string ='aab'; $pattern = '/aaa/'; if(preg_match_all($pattern, $string, $matches, PREG_OFFSET_CAPTURE)) { echo 'test'; } $string ="⏳"; $test = codePoints($string); echo "$test:".print_r($test,true); $pattern = '/23f0|23f3/'; if(preg_match_all($pattern, $test[0], $matches )) { echo 'test2'; }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Array to string conversion in /in/lZXdM on line 29 Array:Array ( [0] => 000023f3 ) test2

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:
43.18 ms | 401 KiB | 8 Q