3v4l.org

run code in 300+ PHP versions simultaneously
<?php $zzfile = random_bytes(100); $filename = basename($zzfile); var_dump(preg_match('#\.(.+)$#', $filename, $matches)); var_dump($matches);
Output for 7.0.0 - 7.0.1, 7.0.3, 7.0.5 - 7.0.20, 7.1.7 - 7.1.27, 7.1.30 - 7.1.33, 7.2.0, 7.2.19, 7.2.21 - 7.2.23, 7.3.1, 7.3.3 - 7.3.9, 7.3.11 - 7.3.12, 7.4.0
int(0) array(0) { }
Output for 7.3.10
int(1) array(2) { [0]=> string(68) ".��с�Yn)E�㒢�V�̘��� w���d��7_wpՅq��:�����讷G0�a�{'IZ" [1]=> string(67) "��с�Yn)E�㒢�V�̘��� w���d��7_wpՅq��:�����讷G0�a�{'IZ" }
Output for 7.3.2
int(1) array(2) { [0]=> string(6) ".�W���" [1]=> string(5) "�W���" }
Output for 7.3.0
int(1) array(2) { [0]=> string(93) ".z��Q��H�L���.t[`��!��2\�Xm� ��'+#�%�|Fm� UG[t>#�1]8�hW��1s�q�lW+e�o���d�a��v��p�" [1]=> string(92) "z��Q��H�L���.t[`��!��2\�Xm� ��'+#�%�|Fm� UG[t>#�1]8�hW��1s�q�lW+e�o���d�a��v��p�" }
Output for 7.2.25
int(1) array(2) { [0]=> string(32) ".싰�� �����d�\��ǥx�>M��Lii�" [1]=> string(31) "싰�� �����d�\��ǥx�>M��Lii�" }
Output for 7.2.24
int(1) array(2) { [0]=> string(35) "._�ːK�1#,{F���z�m�˛"<��J�.FVy" [1]=> string(34) "_�ːK�1#,{F���z�m�˛"<��J�.FVy" }
Output for 7.2.20
int(1) array(2) { [0]=> string(86) ".�����^��v���o.6Q�%�.��H���|.�YZ �h��>��v�p�N���C�7�t�]��X��d� ���'����" [1]=> string(85) "�����^��v���o.6Q�%�.��H���|.�YZ �h��>��v�p�N���C�7�t�]��X��d� ���'����" }
Output for 7.2.18
int(1) array(2) { [0]=> string(30) ".������İ>u��a-A��iͱ�˿����4" [1]=> string(29) "������İ>u��a-A��iͱ�˿����4" }
Output for 7.2.17
int(1) array(2) { [0]=> string(40) ".p+u����B�Ƹ�(�?f��T��g��<�}t�,��ñi" [1]=> string(39) "p+u����B�Ƹ�(�?f��T��g��<�}t�,��ñi" }
Output for 7.1.29
int(1) array(2) { [0]=> string(15) ".��s ���)0Y" [1]=> string(14) "��s ���)0Y" }
Output for 7.1.28
int(1) array(2) { [0]=> string(90) ".�A�WLv�xr�5$�]U|#����%�IQ��]�OY�F���i�Ԭ��qf�q�N}��(��(F�wM™O��z��o����̃" [1]=> string(89) "�A�WLv�xr�5$�]U|#����%�IQ��]�OY�F���i�Ԭ��qf�q�N}��(��(F�wM™O��z��o����̃" }
Output for 7.1.6
int(1) array(2) { [0]=> string(66) ".A?Q}�;e�׭ӫ���B����Yt!f6����{��Z5�61�:hBB�3Q�q+�i�[ � ^b" [1]=> string(65) "A?Q}�;e�׭ӫ���B����Yt!f6����{��Z5�61�:hBB�3Q�q+�i�[ � ^b" }
Output for 7.1.5
int(1) array(2) { [0]=> string(57) ".-w��9db�S�њ���-�;���q�x�"н�N����(Se�bt�Wج2�" [1]=> string(56) "-w��9db�S�њ���-�;���q�x�"н�N����(Se�bt�Wج2�" }
Output for 7.1.0
int(1) array(2) { [0]=> string(27) ".���7�B���D+q�oL� _X�nr�" [1]=> string(26) "���7�B���D+q�oL� _X�nr�" }
Output for 7.0.4
int(1) array(2) { [0]=> string(61) ".��;��C,��>8r�DS���&ʟ�~a~`�w�˰��4\.<������Q��<עU����" [1]=> string(60) "��;��C,��>8r�DS���&ʟ�~a~`�w�˰��4\.<������Q��<עU����" }
Output for 7.0.2
int(1) array(2) { [0]=> string(29) ".�J��C��ew�E�vC��� Kd�$��" [1]=> string(28) "�J��C��ew�E�vC��� Kd�$��" }
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/10iGa on line 3
Process exited with code 255.

preferences:
90.6 ms | 402 KiB | 77 Q