3v4l.org

run code in 300+ PHP versions simultaneously
<?php $params = [ 'subject' => 'Hello 7', // normally third parameter 'pattern' => '/[a-z ]/', // normally first parameter // 'limit' // normally fourth parameter, omitted for this demonstration; the default -1 will be used 'count' => &$counted, // normally fifth parameter // ^-- don't forget to make it modifiable! 'replacement' => '', // normally second parameter ]; echo preg_replace(...$params) . "\n" . $counted;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0F2Cg
function name:  (null)
number of ops:  13
compiled vars:  !0 = $params, !1 = $counted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_ARRAY                                       ~2      'Hello+7', 'subject'
    5     1        ADD_ARRAY_ELEMENT                                ~2      '%2F%5Ba-z+%5D%2F', 'pattern'
    7     2        ADD_ARRAY_ELEMENT                                ~2      !1, 'count'
    9     3        ADD_ARRAY_ELEMENT                                ~2      '', 'replacement'
    3     4        ASSIGN                                                   !0, ~2
   11     5        INIT_FCALL                                               'preg_replace'
          6        SEND_UNPACK                                              !0
          7        CHECK_UNDEF_ARGS                                         
          8        DO_ICALL                                         $4      
          9        CONCAT                                           ~5      $4, '%0A'
         10        CONCAT                                           ~6      ~5, !1
         11        ECHO                                                     ~6
   12    12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.27 ms | 996 KiB | 14 Q