3v4l.org

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

Class Reference:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JGh91
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
    6     3      > RETURN                                                   null

End of function __construct

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

End of function startswith

End of class Reference.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.63 ms | 1392 KiB | 17 Q