3v4l.org

run code in 300+ PHP versions simultaneously
<?php $f = function(int $i) { var_dump($i); }; // Some::new() // Some::match() final class Mangling { private $mangle = []; public function __construct(...$args) { foreach ($args as $arg) { if ($arg !== null) { if (is_callable($arg)) { $this->mangle[] = serialize($arg); } else { $this->mangle[] = (string) $arg; } } else { $this->mangle[] = '_'; } } } public static function new(...$args): self { return new self(...$args); } public function implode(string $glue): string { return implode($glue, $this->mangle); } } const _ = null; interface MatchingInterface { public function matches(array $cases): void; } interface DestructureInterface { public function destruct(): array; } trait MatchingTrait { private $mangling; private $values = []; public function __construct(...$values) { $this->mangling = new Mangling(...$values); $this->values = $values; } public static function new(...$values): self { return new self($values); } private static function into(Mangling $mangling): string { return sprintf('%s(%s)', static::class, $mangling->implode(',')); } public static function match(...$values): string { return self::into(new Mangling(...$values)); } private static function unserialize(string $s) { return @unserialize($s); } private function getPatternMatchWith(array $pattern): array { $cp = count($pattern); $mangle = []; $params = []; foreach ($this->values as $index => $value) { if ($index >= $cp) { $params[] = $value; continue; } if (array_key_exists($index, $pattern) && $pattern[$index] !== _) { $pat = $pattern[$index]; if ($pat !== _) { $closure = self::unserialize($pat); if (is_callable($closure) && !$closure($value)) { return ['mangle' => _, 'params' => []]; } } $params[] = $value; $mangle[] = $value; } else { $mangle[] = _; } } return ['mangle' => self::into(new Mangling(...$mangle)), 'params' => $params]; } private static function intoPattern(string $mangling): array { $pattern = sprintf('/%s\((.+)\)/i', static::class); if (preg_match($pattern, $mangling, $matches)) { return array_map(function(string $param) { return trim($param) === '_' ? _ : $param; }, preg_split('/,\s*/', $matches[1])); } return []; } private function intoMangling(array $pattern): string { $output = []; foreach ($pattern as $index => $value) { if ($value !== _ && self::unserialize($value) !== false) { $output[] = $this->values[$index]; } else { $output[] = $value; } } return self::into(new Mangling(...$output)); } public function matches(array $cases): void { foreach ($cases as $mangling => $closure) { $pattern = self::intoPattern($mangling); ['mangle' => $mangle, 'params' => $params] = $this->getPatternMatchWith($pattern); if ($this->intoMangling($pattern) === $mangle) { $closure(...$params); break; } } } public function toString(): string { return sprintf('%s(%s)', static::class, $this->mangling->implode(',')); } public function __toString(): string { return $this->toString(); } } trait DestructureTrait { public function destruct(): array { return $this->values; } } interface ADTInterface extends MatchingInterface, DestructureInterface { } trait ADTTrait { use MatchingTrait; use DestructureTrait; } final class TypeClosure { private $name; private $typecheck; private $value; public function __construct(string $name, callable $typecheck, &$value) { $this->name = $name; $this->typecheck = $typecheck; $this->value = &$value; } public function __invoke($param): bool { $this->value = ($this->typecheck)($param) ? $param : _; return $this->value !== _; } } function typeof(string $name, callable $typecheck, &$value): TypeClosure { return new TypeClosure($name, $typecheck, $value); } function int(&$value = null): TypeClosure { return typeof('int', 'is_int', $value); } function any(&$value = null): TypeClosure { return typeof('any', function() { return true; }, $value); } function string(&$value = null): TypeClosure { return typeof('string', 'is_string', $value); } final class LetBinding { private $destructure; public function __construct(DestructureInterface $destructure) { $this->destructure = $destructure; } public function be(...$closures): bool { $params = $this->destructure->destruct(); foreach ($closures as $index => $closure) { if (array_key_exists($index, $params) && is_callable($closure)) { $param = $params[$index]; if (!$closure($param)) { return false; } } } return true; } } function let(DestructureInterface $destructure): LetBinding { return new LetBinding($destructure); } interface Option { } final class Some implements Option, ADTInterface { use ADTTrait; } $opt = new Some(42, 23); print '#1: '; $opt->matches([Some::match(_, 23) => $f]); print '#2: '; $opt->matches([Some::match(_) => $f]); print '#3: '; if (let($opt)->be(int($x), int($y))) { var_dump($x); var_dump($y); } print '#4: '; if (let($opt)->be(_, int($y))) { var_dump($y); } interface Gender { } final class Male implements Gender, ADTInterface { use ADTTrait; } final class Female implements Gender, ADTInterface { use ADTTrait; } final class Other implements Gender, ADTInterface { use ADTTrait; } function gender1(Gender $gender): void { print '#5: '; $gender->matches([Male::match(string($name), _) => function(string $name) { var_dump($name); }]); } function gender2(Gender $gender): void { print '#5: '; $gender->matches([Male::match(_) => function(string $name) { var_dump($name); }]); } $gender = new Male('Hans', 'Franz'); gender1($gender); gender2($gender);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 52
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 65, Position 2 = 68
Branch analysis from position: 65
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 68
Branch analysis from position: 52
filename:       /in/Ajrb3
function name:  (null)
number of ops:  83
compiled vars:  !0 = $f, !1 = $opt, !2 = $x, !3 = $y, !4 = $gender
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAjrb3%3A3%240'
          1        ASSIGN                                                   !0, ~5
   40     2        DECLARE_CONST                                            '_', null
   52     3        DECLARE_CLASS                                            'matchingtrait'
  172     4        DECLARE_CLASS                                            'adtinterface'
  176     5        DECLARE_CLASS                                            'adttrait'
  256     6        DECLARE_CLASS                                            'some'
  261     7        NEW                                              $7      'Some'
          8        SEND_VAL_EX                                              42
          9        SEND_VAL_EX                                              23
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
  262    12        ECHO                                                     '%231%3A+'
  263    13        INIT_METHOD_CALL                                         !1, 'matches'
         14        INIT_STATIC_METHOD_CALL                                  'Some', 'match'
         15        FETCH_CONSTANT                                   ~10     '_'
         16        SEND_VAL_EX                                              ~10
         17        SEND_VAL_EX                                              23
         18        DO_FCALL                                      0  $11     
         19        INIT_ARRAY                                       ~12     !0, $11
         20        SEND_VAL_EX                                              ~12
         21        DO_FCALL                                      0          
  264    22        ECHO                                                     '%232%3A+'
  265    23        INIT_METHOD_CALL                                         !1, 'matches'
         24        INIT_STATIC_METHOD_CALL                                  'Some', 'match'
         25        FETCH_CONSTANT                                   ~14     '_'
         26        SEND_VAL_EX                                              ~14
         27        DO_FCALL                                      0  $15     
         28        INIT_ARRAY                                       ~16     !0, $15
         29        SEND_VAL_EX                                              ~16
         30        DO_FCALL                                      0          
  267    31        ECHO                                                     '%233%3A+'
  268    32        INIT_FCALL                                               'let'
         33        SEND_VAR                                                 !1
         34        DO_FCALL                                      0  $18     
         35        INIT_METHOD_CALL                                         $18, 'be'
         36        INIT_FCALL                                               'int'
         37        SEND_REF                                                 !2
         38        DO_FCALL                                      0  $19     
         39        SEND_VAR_NO_REF_EX                                       $19
         40        INIT_FCALL                                               'int'
         41        SEND_REF                                                 !3
         42        DO_FCALL                                      0  $20     
         43        SEND_VAR_NO_REF_EX                                       $20
         44        DO_FCALL                                      0  $21     
         45      > JMPZ                                                     $21, ->52
  269    46    >   INIT_FCALL                                               'var_dump'
         47        SEND_VAR                                                 !2
         48        DO_ICALL                                                 
  270    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !3
         51        DO_ICALL                                                 
  273    52    >   ECHO                                                     '%234%3A+'
  274    53        INIT_FCALL                                               'let'
         54        SEND_VAR                                                 !1
         55        DO_FCALL                                      0  $24     
         56        INIT_METHOD_CALL                                         $24, 'be'
         57        FETCH_CONSTANT                                   ~25     '_'
         58        SEND_VAL_EX                                              ~25
         59        INIT_FCALL                                               'int'
         60        SEND_REF                                                 !3
         61        DO_FCALL                                      0  $26     
         62        SEND_VAR_NO_REF_EX                                       $26
         63        DO_FCALL                                      0  $27     
         64      > JMPZ                                                     $27, ->68
  275    65    >   INIT_FCALL                                               'var_dump'
         66        SEND_VAR                                                 !3
         67        DO_ICALL                                                 
  280    68    >   DECLARE_CLASS                                            'male'
  285    69        DECLARE_CLASS                                            'female'
  290    70        DECLARE_CLASS                                            'other'
  311    71        NEW                                              $29     'Male'
         72        SEND_VAL_EX                                              'Hans'
         73        SEND_VAL_EX                                              'Franz'
         74        DO_FCALL                                      0          
         75        ASSIGN                                                   !4, $29
  312    76        INIT_FCALL                                               'gender1'
         77        SEND_VAR                                                 !4
         78        DO_FCALL                                      0          
  313    79        INIT_FCALL                                               'gender2'
         80        SEND_VAR                                                 !4
         81        DO_FCALL                                      0          
         82      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FAjrb3%3A3%240

Function %00%7Bclosure%7D%2Fin%2FAjrb3%3A119%241:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  {closure}
number of ops:  12
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  119     0  E >   RECV                                             !0      
  120     1        INIT_FCALL                                               'trim'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        IS_IDENTICAL                                             $1, '_'
          5      > JMPZ                                                     ~2, ->9
          6    >   FETCH_CONSTANT                                   ~3      '_'
          7        QM_ASSIGN                                        ~4      ~3
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~4      !0
         10    > > RETURN                                                   ~4
  121    11*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAjrb3%3A119%241

Function typeof:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  typeof
number of ops:  12
compiled vars:  !0 = $name, !1 = $typecheck, !2 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  202     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
  204     3        NEW                                              $3      'TypeClosure'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        SEND_VAR_EX                                              !2
          7        DO_FCALL                                      0          
          8        VERIFY_RETURN_TYPE                                       $3
          9      > RETURN                                                   $3
  205    10*       VERIFY_RETURN_TYPE                                       
         11*     > RETURN                                                   null

End of function typeof

Function int:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  int
number of ops:  10
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  207     0  E >   RECV_INIT                                        !0      null
  209     1        INIT_FCALL                                               'typeof'
          2        SEND_VAL                                                 'int'
          3        SEND_VAL                                                 'is_int'
          4        SEND_REF                                                 !0
          5        DO_FCALL                                      0  $1      
          6        VERIFY_RETURN_TYPE                                       $1
          7      > RETURN                                                   $1
  210     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function int

Function any:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  any
number of ops:  11
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  212     0  E >   RECV_INIT                                        !0      null
  214     1        INIT_FCALL                                               'typeof'
          2        SEND_VAL                                                 'any'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAjrb3%3A214%245'
  216     4        SEND_VAL                                                 ~1
          5        SEND_REF                                                 !0
          6        DO_FCALL                                      0  $2      
          7        VERIFY_RETURN_TYPE                                       $2
          8      > RETURN                                                   $2
  217     9*       VERIFY_RETURN_TYPE                                       
         10*     > RETURN                                                   null

End of function any

Function %00%7Bclosure%7D%2Fin%2FAjrb3%3A214%245:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  {closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  215     0  E > > RETURN                                                   <true>
  216     1*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAjrb3%3A214%245

Function string:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  string
number of ops:  10
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  219     0  E >   RECV_INIT                                        !0      null
  221     1        INIT_FCALL                                               'typeof'
          2        SEND_VAL                                                 'string'
          3        SEND_VAL                                                 'is_string'
          4        SEND_REF                                                 !0
          5        DO_FCALL                                      0  $1      
          6        VERIFY_RETURN_TYPE                                       $1
          7      > RETURN                                                   $1
  222     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function string

Function let:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  let
number of ops:  8
compiled vars:  !0 = $destructure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  249     0  E >   RECV                                             !0      
  251     1        NEW                                              $1      'LetBinding'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
  252     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function let

Function gender1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  gender1
number of ops:  16
compiled vars:  !0 = $gender, !1 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  295     0  E >   RECV                                             !0      
  297     1        ECHO                                                     '%235%3A+'
  298     2        INIT_METHOD_CALL                                         !0, 'matches'
          3        INIT_STATIC_METHOD_CALL                                  'Male', 'match'
          4        INIT_FCALL                                               'string'
          5        SEND_REF                                                 !1
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR_NO_REF_EX                                       $2
          8        FETCH_CONSTANT                                   ~3      '_'
          9        SEND_VAL_EX                                              ~3
         10        DO_FCALL                                      0  $4      
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAjrb3%3A298%24a'
  300    12        INIT_ARRAY                                       ~6      ~5, $4
         13        SEND_VAL_EX                                              ~6
         14        DO_FCALL                                      0          
  301    15      > RETURN                                                   null

End of function gender1

Function %00%7Bclosure%7D%2Fin%2FAjrb3%3A298%24a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  298     0  E >   RECV                                             !0      
  299     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
  300     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAjrb3%3A298%24a

Function gender2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  gender2
number of ops:  12
compiled vars:  !0 = $gender
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  303     0  E >   RECV                                             !0      
  305     1        ECHO                                                     '%235%3A+'
  306     2        INIT_METHOD_CALL                                         !0, 'matches'
          3        INIT_STATIC_METHOD_CALL                                  'Male', 'match'
          4        FETCH_CONSTANT                                   ~1      '_'
          5        SEND_VAL_EX                                              ~1
          6        DO_FCALL                                      0  $2      
          7        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FAjrb3%3A306%24b'
  308     8        INIT_ARRAY                                       ~4      ~3, $2
          9        SEND_VAL_EX                                              ~4
         10        DO_FCALL                                      0          
  309    11      > RETURN                                                   null

End of function gender2

Function %00%7Bclosure%7D%2Fin%2FAjrb3%3A306%24b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  306     0  E >   RECV                                             !0      
  307     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
  308     4      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FAjrb3%3A306%24b

Class Mangling:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 25
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 21
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/Ajrb3
function name:  __construct
number of ops:  27
compiled vars:  !0 = $args, !1 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV_VARIADIC                                    !0      
   16     1      > FE_RESET_R                                       $2      !0, ->25
          2    > > FE_FETCH_R                                               $2, !1, ->25
   17     3    >   TYPE_CHECK                                  1020          !1
          4      > JMPZ                                                     ~3, ->21
   18     5    >   INIT_FCALL                                               'is_callable'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $4      
          8      > JMPZ                                                     $4, ->16
   19     9    >   INIT_FCALL                                               'serialize'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $7      
         12        FETCH_OBJ_W                                      $5      'mangle'
         13        ASSIGN_DIM                                               $5
         14        OP_DATA                                                  $7
         15      > JMP                                                      ->20
   21    16    >   CAST                                          6  ~10     !1
         17        FETCH_OBJ_W                                      $8      'mangle'
         18        ASSIGN_DIM                                               $8
         19        OP_DATA                                                  ~10
         20    > > JMP                                                      ->24
   24    21    >   FETCH_OBJ_W                                      $11     'mangle'
         22        ASSIGN_DIM                                               $11
         23        OP_DATA                                                  '_'
   16    24    > > JMP                                                      ->2
         25    >   FE_FREE                                                  $2
   27    26      > RETURN                                                   null

End of function __construct

Function new:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  new
number of ops:  9
compiled vars:  !0 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   RECV_VARIADIC                                    !0      
   31     1        NEW                          self                $1      
          2        SEND_UNPACK                                              !0
          3        CHECK_UNDEF_ARGS                                         
          4        DO_FCALL                                      1          
          5        VERIFY_RETURN_TYPE                                       $1
          6      > RETURN                                                   $1
   32     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function new

Function implode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  implode
number of ops:  10
compiled vars:  !0 = $glue
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   RECV                                             !0      
   36     1        INIT_FCALL                                               'implode'
          2        SEND_VAR                                                 !0
          3        FETCH_OBJ_R                                      ~1      'mangle'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        VERIFY_RETURN_TYPE                                       $2
          7      > RETURN                                                   $2
   37     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function implode

End of class Mangling.

Class MatchingInterface:
Function matches:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  matches
number of ops:  2
compiled vars:  !0 = $cases
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function matches

End of class MatchingInterface.

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

End of function destruct

End of class DestructureInterface.

Class MatchingTrait:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  __construct
number of ops:  10
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E >   RECV_VARIADIC                                    !0      
   59     1        NEW                                              $2      'Mangling'
          2        SEND_UNPACK                                              !0
          3        CHECK_UNDEF_ARGS                                         
          4        DO_FCALL                                      1          
          5        ASSIGN_OBJ                                               'mangling'
          6        OP_DATA                                                  $2
   60     7        ASSIGN_OBJ                                               'values'
          8        OP_DATA                                                  !0
   61     9      > RETURN                                                   null

End of function __construct

Function new:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  new
number of ops:  8
compiled vars:  !0 = $values
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   63     0  E >   RECV_VARIADIC                                    !0      
   65     1        NEW                          self                $1      
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   66     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function new

Function into:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  into
number of ops:  14
compiled vars:  !0 = $mangling
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   68     0  E >   RECV                                             !0      
   70     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%25s%28%25s%29'
          3        FETCH_CLASS_NAME                                 ~1      
          4        SEND_VAL                                                 ~1
          5        INIT_METHOD_CALL                                         !0, 'implode'
          6        SEND_VAL_EX                                              '%2C'
          7        DO_FCALL                                      0  $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                         $3      
         10        VERIFY_RETURN_TYPE                                       $3
         11      > RETURN                                                   $3
   71    12*       VERIFY_RETURN_TYPE                                       
         13*     > RETURN                                                   null

End of function into

Function match:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ajrb3
function name:  match
number of ops:  12
compiled vars:  !0 = $values
line      #

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.1 ms | 1435 KiB | 36 Q