3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PilotId { protected $pid; /** * @param PilotId|string $pid */ public function __construct($pid){ if(!preg_match("/^(AFA|PAY)([0-9]{4})$/", (string)$pid)) throw new \InvalidArgumentException('Invalid PID'); $this->pid = $pid; } function __toString(){ return $this->pid; } } echo new PilotId("AFA-1111");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8TXPM
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'pilotid'
   21     1        NEW                                              $0      'PilotId'
          2        SEND_VAL_EX                                              'AFA-1111'
          3        DO_FCALL                                      0          
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Class PilotId:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8TXPM
function name:  __construct
number of ops:  15
compiled vars:  !0 = $pid
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2F%5E%28AFA%7CPAY%29%28%5B0-9%5D%7B4%7D%29%24%2F'
          3        CAST                                          6  ~1      !0
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        BOOL_NOT                                         ~3      $2
          7      > JMPZ                                                     ~3, ->12
   12     8    >   NEW                                              $4      'InvalidArgumentException'
          9        SEND_VAL_EX                                              'Invalid+PID'
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $4
   13    12    >   ASSIGN_OBJ                                               'pid'
         13        OP_DATA                                                  !0
   14    14      > RETURN                                                   null

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8TXPM
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   FETCH_OBJ_R                                      ~0      'pid'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   18     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

End of class PilotId.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.6 ms | 1396 KiB | 15 Q