3v4l.org

run code in 500+ 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 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
Branch analysis from position: 21
filename:       /in/WILb3
function name:  __call
number of ops:  23
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        FRAMELESS_ICALL_2                preg_match          ~9      !3, !0
          6      > JMPZ                                                         ~9, ->12
   18     7    >   FRAMELESS_ICALL_2                preg_match          ~10     !4, !0
          8      > JMPZ                                                         ~10, ->11
   19     9    >   FETCH_OBJ_R                                          ~11     'number'
         10      > RETURN                                                       ~11
   17    11    > > JMP                                                          ->21
   21    12    >   FRAMELESS_ICALL_2                preg_match          ~12     !2, !0
         13      > JMPZ                                                         ~12, ->21
   22    14    >   FRAMELESS_ICALL_2                preg_match          ~13     !4, !0
         15      > JMPZ                                                         ~13, ->21
   23    16    >   FETCH_DIM_R                                          ~14     !1, 0
         17        ASSIGN                                                       !5, ~14
   24    18        ASSIGN_OBJ                                                   'number'
         19        OP_DATA                                                      !5
   25    20      > RETURN                                                       0
   28    21    >   VERIFY_RETURN_TYPE                                           
         22      > RETURN                                                       null

End of function __call

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
175.64 ms | 1586 KiB | 14 Q