3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ReferenceChecker { const FIRST = 0; function __initialize($starter = "AWB0") { $this->starter = $starter; } function check($reference) { return strpos($reference, $this->starter) === FIRST; } } $checker = new ReferenceChecker; $subject = "AWB012345"; $result = $checker->check($subject); var_dump($result); $subject = "12345"; $result = $checker->check($subject); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oRrBC
function name:  (null)
number of ops:  20
compiled vars:  !0 = $checker, !1 = $subject, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $3      'ReferenceChecker'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   17     3        ASSIGN                                                   !1, 'AWB012345'
   18     4        INIT_METHOD_CALL                                         !0, 'check'
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !2, $7
   19     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
   21    11        ASSIGN                                                   !1, '12345'
   22    12        INIT_METHOD_CALL                                         !0, 'check'
         13        SEND_VAR_EX                                              !1
         14        DO_FCALL                                      0  $11     
         15        ASSIGN                                                   !2, $11
   23    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class ReferenceChecker:
Function __initialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oRrBC
function name:  __initialize
number of ops:  4
compiled vars:  !0 = $starter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV_INIT                                        !0      'AWB0'
    7     1        ASSIGN_OBJ                                               'starter'
          2        OP_DATA                                                  !0
    8     3      > RETURN                                                   null

End of function __initialize

Function check:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/oRrBC
function name:  check
number of ops:  10
compiled vars:  !0 = $reference
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        FETCH_OBJ_R                                      ~1      'starter'
          4        SEND_VAL                                                 ~1
          5        DO_ICALL                                         $2      
          6        FETCH_CONSTANT                                   ~3      'FIRST'
          7        IS_IDENTICAL                                     ~4      $2, ~3
          8      > RETURN                                                   ~4
   12     9*     > RETURN                                                   null

End of function check

End of class ReferenceChecker.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.41 ms | 1400 KiB | 17 Q