3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Painter { const COLOR_PHYSIC = 'brown'; const COLOR_PSYCHIC = 'purple'; const COLOR_ATTACKER = 'dodgerblue'; const COLOR_DEFENDER = 'darkorange'; public function colorize($text, $color) { return sprintf('<span class="%s">%s</span>', $color, $text); } } $painter = new Painter; echo $painter->colorize('Text', 'red'); echo $painter->colorize('Text', Painter::COLOR_DEFENDER);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VAI1q
function name:  (null)
number of ops:  14
compiled vars:  !0 = $painter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Painter'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_METHOD_CALL                                         !0, 'colorize'
          4        SEND_VAL_EX                                              'Text'
          5        SEND_VAL_EX                                              'red'
          6        DO_FCALL                                      0  $4      
          7        ECHO                                                     $4
   16     8        INIT_METHOD_CALL                                         !0, 'colorize'
          9        SEND_VAL_EX                                              'Text'
         10        SEND_VAL_EX                                              'darkorange'
         11        DO_FCALL                                      0  $5      
         12        ECHO                                                     $5
         13      > RETURN                                                   1

Class Painter:
Function colorize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VAI1q
function name:  colorize
number of ops:  9
compiled vars:  !0 = $text, !1 = $color
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    9     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%3Cspan+class%3D%22%25s%22%3E%25s%3C%2Fspan%3E'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7      > RETURN                                                   $2
   10     8*     > RETURN                                                   null

End of function colorize

End of class Painter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.43 ms | 1395 KiB | 15 Q