3v4l.org

run code in 300+ PHP versions simultaneously
<?php function label_italics($string) { return preg_replace(['/<i>/', '/<\/i>/', '/[^#]/', '/##0/', '/#0/'], ['#', '#', '0', '2', '1'], $string); } $string = 'Disney movies: <i>Aladdin</i>, <i>Beauty and the Beast</i>. Does this <i></i> work?'; $stripped = strip_tags($string, 'i'); echo $string . PHP_EOL; echo $stripped . PHP_EOL; echo label_italics($string) . PHP_EOL;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cKG46
function name:  (null)
number of ops:  16
compiled vars:  !0 = $string, !1 = $stripped
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 'Disney+movies%3A+%3Ci%3EAladdin%3C%2Fi%3E%2C+%3Ci%3EBeauty+and+the+Beast%3C%2Fi%3E.+Does+this+%3Ci%3E%3C%2Fi%3E+work%3F'
    9     1        INIT_FCALL                                               'strip_tags'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'i'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !1, $3
   10     6        CONCAT                                           ~5      !0, '%0A'
          7        ECHO                                                     ~5
   11     8        CONCAT                                           ~6      !1, '%0A'
          9        ECHO                                                     ~6
   12    10        INIT_FCALL                                               'label_italics'
         11        SEND_VAR                                                 !0
         12        DO_FCALL                                      0  $7      
         13        CONCAT                                           ~8      $7, '%0A'
         14        ECHO                                                     ~8
   13    15      > RETURN                                                   1

Function label_italics:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cKG46
function name:  label_italics
number of ops:  8
compiled vars:  !0 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 <array>
    5     3        SEND_VAL                                                 <array>
          4        SEND_VAR                                                 !0
    4     5        DO_ICALL                                         $1      
    5     6      > RETURN                                                   $1
    6     7*     > RETURN                                                   null

End of function label_italics

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.36 ms | 1003 KiB | 16 Q