3v4l.org

run code in 300+ PHP versions simultaneously
<?php define("CLI", !isset($_SERVER['HTTP_USER_AGENT'])); $lt = (CLI) ? "\r\n" : "<br />"; /** * Abstract Surfer Class * * @package hangten */ abstract class Surfer { abstract public function rideWave($amplitude); public function applyWax($waxType){ $this->printMessage("Ahh, all waxed up with '".$waxType."', ready to go!"); } public function paddleOut(){ $this->printMessage("Paddling...."); } public function screamShark(){ $this->printMessage("SHARK!!"); } public function printMessage($msg = ""){ $lt = (isset($_SERVER['HTTP_USER_AGENT'])) ? "<br />" : "\r\n"; print($msg.$lt); } } /** * RookieSurfer Class * * This surfer is green and can barely surf =) * @package hangten */ class RookieSurfer extends Surfer { public function rideWave($amplitude = 1){ $this->printMessage("Trying.. Trying.. to ride a ".$amplitude."ft. wave, whew!"); } } /** * ProSurfer Class * * This surfer is crazy skilled!! * @package hangten */ class ProSurfer extends Surfer { public function rideWave($amplitude = 8){ $this->printMessage("Riding a ".$amplitude."ft. wave backwards doing a backflip!"); } public function killSharkWithBoard(){ $this->printMessage("totally just sliced that shark in two, he's over it!! booya!"); } } // Rookie Instantiation $rookie = new RookieSurfer; $rookie->applyWax("Candle Wax"); $rookie->paddleOut(); $rookie->rideWave(2); $rookie->screamShark(); // Pro Instantiation $pro = new ProSurfer; $pro->applyWax("Sex Wax"); $pro->paddleOut(); $pro->rideWave(50); $pro->killSharkWithBoard();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  (null)
number of ops:  40
compiled vars:  !0 = $lt, !1 = $rookie, !2 = $pro
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'CLI'
          2        FETCH_IS                                         ~3      '_SERVER'
          3        ISSET_ISEMPTY_DIM_OBJ                         0  ~4      ~3, 'HTTP_USER_AGENT'
          4        BOOL_NOT                                         ~5      ~4
          5        SEND_VAL                                                 ~5
          6        DO_ICALL                                                 
    2     7        FETCH_CONSTANT                                   ~7      'CLI'
          8      > JMPZ                                                     ~7, ->11
          9    >   QM_ASSIGN                                        ~8      '%0D%0A'
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~8      '%3Cbr+%2F%3E'
         12    >   ASSIGN                                                   !0, ~8
   62    13        NEW                                              $10     'RookieSurfer'
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $10
   63    16        INIT_METHOD_CALL                                         !1, 'applyWax'
         17        SEND_VAL_EX                                              'Candle+Wax'
         18        DO_FCALL                                      0          
   64    19        INIT_METHOD_CALL                                         !1, 'paddleOut'
         20        DO_FCALL                                      0          
   65    21        INIT_METHOD_CALL                                         !1, 'rideWave'
         22        SEND_VAL_EX                                              2
         23        DO_FCALL                                      0          
   66    24        INIT_METHOD_CALL                                         !1, 'screamShark'
         25        DO_FCALL                                      0          
   69    26        NEW                                              $17     'ProSurfer'
         27        DO_FCALL                                      0          
         28        ASSIGN                                                   !2, $17
   70    29        INIT_METHOD_CALL                                         !2, 'applyWax'
         30        SEND_VAL_EX                                              'Sex+Wax'
         31        DO_FCALL                                      0          
   71    32        INIT_METHOD_CALL                                         !2, 'paddleOut'
         33        DO_FCALL                                      0          
   72    34        INIT_METHOD_CALL                                         !2, 'rideWave'
         35        SEND_VAL_EX                                              50
         36        DO_FCALL                                      0          
   73    37        INIT_METHOD_CALL                                         !2, 'killSharkWithBoard'
         38        DO_FCALL                                      0          
         39      > RETURN                                                   1

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

End of function ridewave

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  applyWax
number of ops:  7
compiled vars:  !0 = $waxType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Ahh%2C+all+waxed+up+with+%27', !0
          3        CONCAT                                           ~2      ~1, '%27%2C+ready+to+go%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   15     6      > RETURN                                                   null

End of function applywax

Function paddleout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  paddleOut
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Paddling....'
          2        DO_FCALL                                      0          
   19     3      > RETURN                                                   null

End of function paddleout

Function screamshark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  screamShark
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'SHARK%21%21'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function screamshark

Function printmessage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  printMessage
number of ops:  11
compiled vars:  !0 = $msg, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV_INIT                                        !0      ''
   26     1        FETCH_IS                                         ~2      '_SERVER'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, 'HTTP_USER_AGENT'
          3      > JMPZ                                                     ~3, ->6
          4    >   QM_ASSIGN                                        ~4      '%3Cbr+%2F%3E'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      '%0D%0A'
          7    >   ASSIGN                                                   !1, ~4
   27     8        CONCAT                                           ~6      !0, !1
          9        ECHO                                                     ~6
   28    10      > RETURN                                                   null

End of function printmessage

End of class Surfer.

Class RookieSurfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  rideWave
number of ops:  7
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV_INIT                                        !0      1
   40     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Trying..+Trying..+to+ride+a+', !0
          3        CONCAT                                           ~2      ~1, 'ft.+wave%2C+whew%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   41     6      > RETURN                                                   null

End of function ridewave

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  applyWax
number of ops:  7
compiled vars:  !0 = $waxType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Ahh%2C+all+waxed+up+with+%27', !0
          3        CONCAT                                           ~2      ~1, '%27%2C+ready+to+go%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   15     6      > RETURN                                                   null

End of function applywax

Function paddleout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  paddleOut
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Paddling....'
          2        DO_FCALL                                      0          
   19     3      > RETURN                                                   null

End of function paddleout

Function screamshark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  screamShark
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'SHARK%21%21'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function screamshark

Function printmessage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  printMessage
number of ops:  11
compiled vars:  !0 = $msg, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV_INIT                                        !0      ''
   26     1        FETCH_IS                                         ~2      '_SERVER'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, 'HTTP_USER_AGENT'
          3      > JMPZ                                                     ~3, ->6
          4    >   QM_ASSIGN                                        ~4      '%3Cbr+%2F%3E'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      '%0D%0A'
          7    >   ASSIGN                                                   !1, ~4
   27     8        CONCAT                                           ~6      !0, !1
          9        ECHO                                                     ~6
   28    10      > RETURN                                                   null

End of function printmessage

End of class RookieSurfer.

Class ProSurfer:
Function ridewave:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  rideWave
number of ops:  7
compiled vars:  !0 = $amplitude
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   52     0  E >   RECV_INIT                                        !0      8
   53     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Riding+a+', !0
          3        CONCAT                                           ~2      ~1, 'ft.+wave+backwards+doing+a+backflip%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   54     6      > RETURN                                                   null

End of function ridewave

Function killsharkwithboard:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  killSharkWithBoard
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'totally+just+sliced+that+shark+in+two%2C+he%27s+over+it%21%21+booya%21'
          2        DO_FCALL                                      0          
   58     3      > RETURN                                                   null

End of function killsharkwithboard

Function applywax:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  applyWax
number of ops:  7
compiled vars:  !0 = $waxType
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         'printMessage'
          2        CONCAT                                           ~1      'Ahh%2C+all+waxed+up+with+%27', !0
          3        CONCAT                                           ~2      ~1, '%27%2C+ready+to+go%21'
          4        SEND_VAL_EX                                              ~2
          5        DO_FCALL                                      0          
   15     6      > RETURN                                                   null

End of function applywax

Function paddleout:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  paddleOut
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'Paddling....'
          2        DO_FCALL                                      0          
   19     3      > RETURN                                                   null

End of function paddleout

Function screamshark:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  screamShark
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_METHOD_CALL                                         'printMessage'
          1        SEND_VAL_EX                                              'SHARK%21%21'
          2        DO_FCALL                                      0          
   23     3      > RETURN                                                   null

End of function screamshark

Function printmessage:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AMbTf
function name:  printMessage
number of ops:  11
compiled vars:  !0 = $msg, !1 = $lt
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV_INIT                                        !0      ''
   26     1        FETCH_IS                                         ~2      '_SERVER'
          2        ISSET_ISEMPTY_DIM_OBJ                         0          ~2, 'HTTP_USER_AGENT'
          3      > JMPZ                                                     ~3, ->6
          4    >   QM_ASSIGN                                        ~4      '%3Cbr+%2F%3E'
          5      > JMP                                                      ->7
          6    >   QM_ASSIGN                                        ~4      '%0D%0A'
          7    >   ASSIGN                                                   !1, ~4
   27     8        CONCAT                                           ~6      !0, !1
          9        ECHO                                                     ~6
   28    10      > RETURN                                                   null

End of function printmessage

End of class ProSurfer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.17 ms | 1417 KiB | 15 Q