3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TextOperator { const CONTAINS = 'contains'; const CONTAINS_NOT = 'containsnot'; } abstract class Condition { protected $operator; protected $value; public function __construct($value, $operator) { $this->setValue($value); $this->setOperator($operator); } abstract public function setOperator($operator); abstract public function setValue($value); public function getOperator() { return $this->operator; } public function getValue() { return $this->value; } } class TextCondition extends Condition { public function __construct($value, $operator = TextOperator::CONTAINS) { parent::__construct($value, $operator); } public function setOperator($operator) { $this->operator = $operator; } public function setValue($value) { $this->value = (string)$value; } } $cond1 = new TextCondition(TextOperator::CONTAINS, 'foo'); $cond2 = new TextCondition(TextOperator::CONTAINS, 'bar'); var_dump($cond1, $cond2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  (null)
number of ops:  15
compiled vars:  !0 = $cond1, !1 = $cond2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   NEW                                              $2      'TextCondition'
          1        SEND_VAL_EX                                              'contains'
          2        SEND_VAL_EX                                              'foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   53     5        NEW                                              $5      'TextCondition'
          6        SEND_VAL_EX                                              'contains'
          7        SEND_VAL_EX                                              'bar'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
   55    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Class TextOperator: [no user functions]
Class Condition:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  __construct
number of ops:  9
compiled vars:  !0 = $value, !1 = $operator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   16     2        INIT_METHOD_CALL                                         'setValue'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
   17     5        INIT_METHOD_CALL                                         'setOperator'
          6        SEND_VAR_EX                                              !1
          7        DO_FCALL                                      0          
   18     8      > RETURN                                                   null

End of function __construct

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

End of function setoperator

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

End of function setvalue

Function getoperator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  getOperator
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'operator'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function getoperator

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1      > RETURN                                                   ~0
   31     2*     > RETURN                                                   null

End of function getvalue

End of class Condition.

Class TextCondition:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  __construct
number of ops:  7
compiled vars:  !0 = $value, !1 = $operator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <const ast>
   38     2        INIT_STATIC_METHOD_CALL                                  
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   39     6      > RETURN                                                   null

End of function __construct

Function setoperator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  setOperator
number of ops:  4
compiled vars:  !0 = $operator
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   RECV                                             !0      
   43     1        ASSIGN_OBJ                                               'operator'
          2        OP_DATA                                                  !0
   44     3      > RETURN                                                   null

End of function setoperator

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

End of function setvalue

Function getoperator:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  getOperator
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'operator'
          1      > RETURN                                                   ~0
   26     2*     > RETURN                                                   null

End of function getoperator

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LYKlG
function name:  getValue
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~0      'value'
          1      > RETURN                                                   ~0
   31     2*     > RETURN                                                   null

End of function getvalue

End of class TextCondition.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
199.03 ms | 1404 KiB | 15 Q