3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dos{ function __construct(){ return 888888; } } class Container{ public static function _post($campo = 0, $callback = false) { list($post_key, $class) = explode('@', $campo); if (!empty($_POST)) { foreach (filter_var_array($_POST, FILTER_SANITIZE_ENCODED) as $key => $val) { if ($key == $post_key && empty($callback)) { return $val; } if ($key == $post_key && is_callable($callback)) { $oj = $callback->bindTo($callback); print_r($oj); $obj = (class_exists($class)) ? new $class() : ""; (class_exists($class)) ? call_user_func($callback, $obj) : call_user_func($callback); } } } return false; } } class Uno{ public $uno = 1; function __construct(){ return 123; } } $_POST['hi'] = true; Container::_post('hi@Uno', function($app,Dos $dos){ var_dump($dos); });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K8ajm
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   FETCH_W                      global              $0      '_POST'
          1        ASSIGN_DIM                                               $0, 'hi'
          2        OP_DATA                                                  <true>
   50     3        INIT_STATIC_METHOD_CALL                                  'Container', '_post'
          4        SEND_VAL                                                 'hi%40Uno'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FK8ajm%3A50%240'
   53     6        SEND_VAL                                                 ~2
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FK8ajm%3A50%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K8ajm
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $app, !1 = $dos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   52     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                                 
   53     5      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FK8ajm%3A50%240

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

End of function __construct

End of class Dos.

Class Container:
Function _post:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 69
Branch analysis from position: 14
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 68
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 68
Branch analysis from position: 21
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 67
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 52
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 63
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 63
Branch analysis from position: 58
Branch analysis from position: 63
Branch analysis from position: 67
Branch analysis from position: 35
Branch analysis from position: 26
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
Branch analysis from position: 69
filename:       /in/K8ajm
function name:  _post
number of ops:  71
compiled vars:  !0 = $campo, !1 = $callback, !2 = $post_key, !3 = $class, !4 = $val, !5 = $key, !6 = $oj, !7 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV_INIT                                        !0      0
          1        RECV_INIT                                        !1      <false>
   17     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%40'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $8      
          6        FETCH_LIST_R                                     $9      $8, 0
          7        ASSIGN                                                   !2, $9
          8        FETCH_LIST_R                                     $11     $8, 1
          9        ASSIGN                                                   !3, $11
         10        FREE                                                     $8
   18    11        ISSET_ISEMPTY_VAR                             3  ~13     '_POST'
         12        BOOL_NOT                                         ~14     ~13
         13      > JMPZ                                                     ~14, ->69
   20    14    >   INIT_FCALL                                               'filter_var_array'
         15        FETCH_R                      global              ~15     '_POST'
         16        SEND_VAL                                                 ~15
         17        SEND_VAL                                                 514
         18        DO_ICALL                                         $16     
         19      > FE_RESET_R                                       $17     $16, ->68
         20    > > FE_FETCH_R                                       ~18     $17, !4, ->68
         21    >   ASSIGN                                                   !5, ~18
   22    22        IS_EQUAL                                         ~20     !5, !2
         23      > JMPZ_EX                                          ~20     ~20, ->26
         24    >   ISSET_ISEMPTY_CV                                 ~21     !1
         25        BOOL                                             ~20     ~21
         26    > > JMPZ                                                     ~20, ->29
   23    27    >   FE_FREE                                                  $17
         28      > RETURN                                                   !4
   25    29    >   IS_EQUAL                                         ~22     !5, !2
         30      > JMPZ_EX                                          ~22     ~22, ->35
         31    >   INIT_FCALL                                               'is_callable'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                         $23     
         34        BOOL                                             ~22     $23
         35    > > JMPZ                                                     ~22, ->67
   27    36    >   INIT_METHOD_CALL                                         !1, 'bindTo'
         37        SEND_VAR_EX                                              !1
         38        DO_FCALL                                      0  $24     
         39        ASSIGN                                                   !6, $24
   28    40        INIT_FCALL                                               'print_r'
         41        SEND_VAR                                                 !6
         42        DO_ICALL                                                 
   29    43        INIT_FCALL                                               'class_exists'
         44        SEND_VAR                                                 !3
         45        DO_ICALL                                         $27     
         46      > JMPZ                                                     $27, ->52
         47    >   FETCH_CLASS                                   0  $28     !3
         48        NEW                                              $29     $28
         49        DO_FCALL                                      0          
         50        QM_ASSIGN                                        ~31     $29
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~31     ''
         53    >   ASSIGN                                                   !7, ~31
   30    54        INIT_FCALL                                               'class_exists'
         55        SEND_VAR                                                 !3
         56        DO_ICALL                                         $33     
         57      > JMPZ                                                     $33, ->63
         58    >   INIT_USER_CALL                                1          'call_user_func', !1
         59        SEND_USER                                                !7
         60        DO_FCALL                                      0  $34     
         61        QM_ASSIGN                                        ~35     $34
         62      > JMP                                                      ->66
         63    >   INIT_USER_CALL                                0          'call_user_func', !1
         64        DO_FCALL                                      0  $36     
         65        QM_ASSIGN                                        ~35     $36
         66    >   FREE                                                     ~35
   20    67    > > JMP                                                      ->20
         68    >   FE_FREE                                                  $17
   34    69    > > RETURN                                                   <false>
   35    70*     > RETURN                                                   null

End of function _post

End of class Container.

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

End of function __construct

End of class Uno.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.13 ms | 1404 KiB | 25 Q