3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* getName */ class Test { private int $number = 5; public function __call(string $name, array $arguments): mixed { $regexpGet = '/set[a-zA-Z]+/'; $regexpSet = '/get[a-zA-Z]+/'; $regexpNumber = '/Number/'; if (preg_match($regexpSet, $name)) { if (preg_match($regexpNumber, $name)) { return $this->number; } } elseif (preg_match($regexpGet, $name)) { if (preg_match($regexpNumber, $name)) { $valueField = $arguments[0]; $this->number = $valueField; return 0; } } } } $test = new Test(); print_r($test->getNumber() . "\n"); $test->setNumber(10); print_r($test->getNumber());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WILb3
function name:  (null)
number of ops:  18
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   32     3        INIT_FCALL                                               'print_r'
          4        INIT_METHOD_CALL                                         !0, 'getNumber'
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      $4, '%0A'
          7        SEND_VAL                                                 ~5
          8        DO_ICALL                                                 
   33     9        INIT_METHOD_CALL                                         !0, 'setNumber'
         10        SEND_VAL_EX                                              10
         11        DO_FCALL                                      0          
   34    12        INIT_FCALL                                               'print_r'
         13        INIT_METHOD_CALL                                         !0, 'getNumber'
         14        DO_FCALL                                      0  $8      
         15        SEND_VAR                                                 $8
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Class Test:
Function __call:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 33
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 33
filename:       /in/WILb3
function name:  __call
number of ops:  35
compiled vars:  !0 = $name, !1 = $arguments, !2 = $regexpGet, !3 = $regexpSet, !4 = $regexpNumber, !5 = $valueField
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        ASSIGN                                                   !2, '%2Fset%5Ba-zA-Z%5D%2B%2F'
   14     3        ASSIGN                                                   !3, '%2Fget%5Ba-zA-Z%5D%2B%2F'
   15     4        ASSIGN                                                   !4, '%2FNumber%2F'
   17     5        INIT_FCALL                                               'preg_match'
          6        SEND_VAR                                                 !3
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $9      
          9      > JMPZ                                                     $9, ->18
   18    10    >   INIT_FCALL                                               'preg_match'
         11        SEND_VAR                                                 !4
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $10     
         14      > JMPZ                                                     $10, ->17
   19    15    >   FETCH_OBJ_R                                      ~11     'number'
         16      > RETURN                                                   ~11
   17    17    > > JMP                                                      ->33
   21    18    >   INIT_FCALL                                               'preg_match'
         19        SEND_VAR                                                 !2
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $12     
         22      > JMPZ                                                     $12, ->33
   22    23    >   INIT_FCALL                                               'preg_match'
         24        SEND_VAR                                                 !4
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $13     
         27      > JMPZ                                                     $13, ->33
   23    28    >   FETCH_DIM_R                                      ~14     !1, 0
         29        ASSIGN                                                   !5, ~14
   24    30        ASSIGN_OBJ                                               'number'
         31        OP_DATA                                                  !5
   25    32      > RETURN                                                   0
   28    33    >   VERIFY_RETURN_TYPE                                       
         34      > RETURN                                                   null

End of function __call

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.48 ms | 1004 KiB | 15 Q