3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class EmailInserter { protected $emails = array(); public static function printLinks($emails, $int = 1){ if($int > count($emails)){ // Fallback on max $int = count($emails); } $output = ''; while($int--){ $rand = rand(0, count($emails) - 1); $email = $emails[$rand]; unset($emails[$rand]); $emails = array_values($emails); $output .= '<a href="mailto:' . $email . '">' . $email . '</a>' . "\n"; } echo $output; } } class FooEmailInserter extends EmailInserter{ private static $locals = array( "SandieCapone", "KrystleKittinger", "AnnettaOno", "FridaFlagg", "ShirelyCacho", "MercyScarpa", "BurmaMask", "MatthewWarfel", "MyraCoad", "ReneePietz", ); private static $domains = array("gmail", "yahoo"); public static function init($int = 4, $print = true){ $emails = array(); foreach(self::$locals as $local){ foreach(self::$domains as $domain){ $emails[] = "$local@$domain.com"; } } if($print){ self::printLinks($emails, $int); } return $emails; } public function __construct($int = NULL){ $print = $int ? true : false; $this->emails = self::init($int, $print); } public function print($int){ self::printLinks($this->emails, $int); } } $foo = new FooEmailInserter(); $foo->print(10); FooEmailInserter::init();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s9Of2
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   62     0  E >   NEW                                              $1      'FooEmailInserter'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   63     3        INIT_METHOD_CALL                                         !0, 'print'
          4        SEND_VAL_EX                                              10
          5        DO_FCALL                                      0          
   65     6        INIT_STATIC_METHOD_CALL                                  'FooEmailInserter', 'init'
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class EmailInserter:
Function printlinks:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
Branch analysis from position: 9
Branch analysis from position: 7
filename:       /in/s9Of2
function name:  printLinks
number of ops:  33
compiled vars:  !0 = $emails, !1 = $int, !2 = $output, !3 = $rand, !4 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      1
    7     2        COUNT                                            ~5      !0
          3        IS_SMALLER                                               ~5, !1
          4      > JMPZ                                                     ~6, ->7
    9     5    >   COUNT                                            ~7      !0
          6        ASSIGN                                                   !1, ~7
   12     7    >   ASSIGN                                                   !2, ''
   13     8      > JMP                                                      ->29
   14     9    >   INIT_FCALL                                               'rand'
         10        SEND_VAL                                                 0
         11        COUNT                                            ~10     !0
         12        SUB                                              ~11     ~10, 1
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !3, $12
   15    16        FETCH_DIM_R                                      ~14     !0, !3
         17        ASSIGN                                                   !4, ~14
   16    18        UNSET_DIM                                                !0, !3
   17    19        INIT_FCALL                                               'array_values'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !0, $16
   18    23        CONCAT                                           ~18     '%3Ca+href%3D%22mailto%3A', !4
         24        CONCAT                                           ~19     ~18, '%22%3E'
         25        CONCAT                                           ~20     ~19, !4
         26        CONCAT                                           ~21     ~20, '%3C%2Fa%3E'
         27        CONCAT                                           ~22     ~21, '%0A'
         28        ASSIGN_OP                                     8          !2, ~22
   13    29    >   POST_DEC                                         ~24     !1
         30      > JMPNZ                                                    ~24, ->9
   21    31    >   ECHO                                                     !2
   22    32      > RETURN                                                   null

End of function printlinks

End of class EmailInserter.

Class FooEmailInserter:
Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 78) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
Branch analysis from position: 16
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
Branch analysis from position: 18
filename:       /in/s9Of2
function name:  init
number of ops:  26
compiled vars:  !0 = $int, !1 = $print, !2 = $emails, !3 = $local, !4 = $domain
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   40     0  E >   RECV_INIT                                        !0      4
          1        RECV_INIT                                        !1      <true>
   41     2        ASSIGN                                                   !2, <array>
   42     3        FETCH_STATIC_PROP_R          unknown             ~6      'locals'
          4      > FE_RESET_R                                       $7      ~6, ->18
          5    > > FE_FETCH_R                                               $7, !3, ->18
   43     6    >   FETCH_STATIC_PROP_R          unknown             ~8      'domains'
          7      > FE_RESET_R                                       $9      ~8, ->16
          8    > > FE_FETCH_R                                               $9, !4, ->16
   44     9    >   ROPE_INIT                                     4  ~12     !3
         10        ROPE_ADD                                      1  ~12     ~12, '%40'
         11        ROPE_ADD                                      2  ~12     ~12, !4
         12        ROPE_END                                      3  ~11     ~12, '.com'
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  ~11
   43    15      > JMP                                                      ->8
         16    >   FE_FREE                                                  $9
   42    17      > JMP                                                      ->5
         18    >   FE_FREE                                                  $7
   47    19      > JMPZ                                                     !1, ->24
         20    >   INIT_STATIC_METHOD_CALL                                  'printLinks'
         21        SEND_VAR_EX                                              !2
         22        SEND_VAR_EX                                              !0
         23        DO_FCALL                                      0          
   48    24    > > RETURN                                                   !2
   49    25*     > RETURN                                                   null

End of function init

Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s9Of2
function name:  __construct
number of ops:  13
compiled vars:  !0 = $int, !1 = $print
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   51     0  E >   RECV_INIT                                        !0      null
   52     1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~2      <true>
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~2      <false>
          5    >   ASSIGN                                                   !1, ~2
   53     6        INIT_STATIC_METHOD_CALL                                  'init'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !1
          9        DO_FCALL                                      0  $5      
         10        ASSIGN_OBJ                                               'emails'
         11        OP_DATA                                                  $5
   54    12      > RETURN                                                   null

End of function __construct

Function print:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/s9Of2
function name:  print
number of ops:  8
compiled vars:  !0 = $int
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   RECV                                             !0      
   57     1        INIT_STATIC_METHOD_CALL                                  'printLinks'
          2        CHECK_FUNC_ARG                                           
          3        FETCH_OBJ_FUNC_ARG                               $1      'emails'
          4        SEND_FUNC_ARG                                            $1
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   58     7      > RETURN                                                   null

End of function print

Function printlinks:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 9
Branch analysis from position: 31
Branch analysis from position: 9
Branch analysis from position: 7
filename:       /in/s9Of2
function name:  printLinks
number of ops:  33
compiled vars:  !0 = $emails, !1 = $int, !2 = $output, !3 = $rand, !4 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      1
    7     2        COUNT                                            ~5      !0
          3        IS_SMALLER                                               ~5, !1
          4      > JMPZ                                                     ~6, ->7
    9     5    >   COUNT                                            ~7      !0
          6        ASSIGN                                                   !1, ~7
   12     7    >   ASSIGN                                                   !2, ''
   13     8      > JMP                                                      ->29
   14     9    >   INIT_FCALL                                               'rand'
         10        SEND_VAL                                                 0
         11        COUNT                                            ~10     !0
         12        SUB                                              ~11     ~10, 1
         13        SEND_VAL                                                 ~11
         14        DO_ICALL                                         $12     
         15        ASSIGN                                                   !3, $12
   15    16        FETCH_DIM_R                                      ~14     !0, !3
         17        ASSIGN                                                   !4, ~14
   16    18        UNSET_DIM                                                !0, !3
   17    19        INIT_FCALL                                               'array_values'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                         $16     
         22        ASSIGN                                                   !0, $16
   18    23        CONCAT                                           ~18     '%3Ca+href%3D%22mailto%3A', !4
         24        CONCAT                                           ~19     ~18, '%22%3E'
         25        CONCAT                                           ~20     ~19, !4
         26        CONCAT                                           ~21     ~20, '%3C%2Fa%3E'
         27        CONCAT                                           ~22     ~21, '%0A'
         28        ASSIGN_OP                                     8          !2, ~22
   13    29    >   POST_DEC                                         ~24     !1
         30      > JMPNZ                                                    ~24, ->9
   21    31    >   ECHO                                                     !2
   22    32      > RETURN                                                   null

End of function printlinks

End of class FooEmailInserter.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.2 ms | 1408 KiB | 17 Q