3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "um dois três quatro cinco seis"; echo $str, "<br>\n"; echo trim($str), "<br>\n"; echo trim($str, ' '), "<br>\n"; echo preg_replace('/[ ]*/', '', $str), "\n\n"; class Teste { public function __construct() { /* */ } public static function __callStatic($function, $arguments){ if(method_exists(__CLASS__, $function)){ echo "teste fake __ constructor \n"; call_user_func_array( array(__CLASS__, $function), $arguments ); } else { echo "método não existe \n\n"; } } public function teste(){ echo "teste __ method\n"; } } Teste::teste();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7qor2
function name:  (null)
number of ops:  24
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'um+dois+++++tr%C3%AAs+quatro+cinco++++seis'
    4     1        ECHO                                                     !0
          2        ECHO                                                     '%3Cbr%3E%0A'
    5     3        INIT_FCALL                                               'trim'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7        ECHO                                                     '%3Cbr%3E%0A'
    6     8        INIT_FCALL                                               'trim'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '+'
         11        DO_ICALL                                         $3      
         12        ECHO                                                     $3
         13        ECHO                                                     '%3Cbr%3E%0A'
    7    14        INIT_FCALL                                               'preg_replace'
         15        SEND_VAL                                                 '%2F%5B+%5D%2A%2F'
         16        SEND_VAL                                                 ''
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $4      
         19        ECHO                                                     $4
         20        ECHO                                                     '%0A%0A'
   33    21        INIT_STATIC_METHOD_CALL                                  'Teste', 'teste'
         22        DO_FCALL                                      0          
         23      > RETURN                                                   1

Class Teste:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7qor2
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function __construct

Function __callstatic:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7qor2
function name:  __callStatic
number of ops:  17
compiled vars:  !0 = $function, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_FCALL                                               'method_exists'
          3        SEND_VAL                                                 'Teste'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->15
   17     7    >   ECHO                                                     'teste+fake+__+constructor+%0A'
   19     8        INIT_ARRAY                                       ~3      'Teste'
          9        ADD_ARRAY_ELEMENT                                ~3      !0
         10        INIT_USER_CALL                                0          'call_user_func_array', ~3
   20    11        SEND_ARRAY                                               !1
         12        CHECK_UNDEF_ARGS                                         
         13        DO_FCALL                                      0          
         14      > JMP                                                      ->16
   23    15    >   ECHO                                                     'm%C3%A9todo+n%C3%A3o+existe+%0A%0A'
   25    16    > > RETURN                                                   null

End of function __callstatic

Function teste:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7qor2
function name:  teste
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   ECHO                                                     'teste+__+method%0A'
   29     1      > RETURN                                                   null

End of function teste

End of class Teste.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.63 ms | 1400 KiB | 19 Q