3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public $_field = "abcdefghijklmnopqrstuvwxyz"; public function __construct() {} } class B { public $_field = "abcdefghijklmnopqrstuvwxyz"; } $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new A(); $time_taken = microtime(true) - $start; echo 'With construct: ' . $time_taken . 's' . PHP_EOL; $start = microtime(true); for ($i = 0; $i < 100000; $i++) $r = new B(); $time_taken = microtime(true) - $start; echo 'Without construct: ' . $time_taken . 's' . PHP_EOL;
Output for 7.3.1
With construct: 0.010141134262085s Without construct: 0.0067160129547119s
Output for 7.3.0
With construct: 0.010495901107788s Without construct: 0.0059599876403809s
Output for 7.2.13
With construct: 0.011106014251709s Without construct: 0.0069499015808105s
Output for 7.2.12
With construct: 0.0106201171875s Without construct: 0.0081138610839844s
Output for 7.2.11
With construct: 0.009911060333252s Without construct: 0.0064468383789062s
Output for 7.2.10
With construct: 0.010711908340454s Without construct: 0.0063390731811523s
Output for 7.2.9
With construct: 0.010485172271729s Without construct: 0.0075969696044922s
Output for 7.2.8
With construct: 0.01217794418335s Without construct: 0.0065498352050781s
Output for 7.2.7
With construct: 0.011571884155273s Without construct: 0.0066418647766113s
Output for 7.2.6
With construct: 0.01373815536499s Without construct: 0.006659984588623s
Output for 7.2.5
With construct: 0.013913869857788s Without construct: 0.0087599754333496s
Output for 7.2.4
With construct: 0.011143922805786s Without construct: 0.006702184677124s
Output for 7.2.3
With construct: 0.0098190307617188s Without construct: 0.0065410137176514s
Output for 7.2.2
With construct: 0.011079072952271s Without construct: 0.0065000057220459s
Output for 7.2.1
With construct: 0.012320041656494s Without construct: 0.0066349506378174s
Output for 7.2.0
With construct: 0.0092599391937256s Without construct: 0.0063269138336182s
Output for 7.1.25
With construct: 0.020802974700928s Without construct: 0.01291298866272s
Output for 7.1.7
With construct: 0.01010799407959s Without construct: 0.0063719749450684s
Output for 7.1.6
With construct: 0.017474889755249s Without construct: 0.01195502281189s
Output for 7.1.5
With construct: 0.018403053283691s Without construct: 0.012562990188599s
Output for 7.1.0
With construct: 0.013687133789062s Without construct: -0.0076169967651367s
Output for 7.0.20
With construct: 0.015084981918335s Without construct: 0.0060079097747803s
Output for 7.0.14
With construct: 0.014196157455444s Without construct: 0.0099780559539795s
Output for 7.0.11
With construct: 0.011656999588013s Without construct: 0.0090689659118652s
Output for 7.0.10
With construct: 0.01614785194397s Without construct: 0.010133028030396s
Output for 7.0.9
With construct: 0.0084140300750732s Without construct: 0.0059010982513428s
Output for 7.0.8
With construct: 0.019376993179321s Without construct: 0.013689041137695s
Output for 7.0.7
With construct: 0.020540952682495s Without construct: 0.013988018035889s
Output for 7.0.6
With construct: 0.014404058456421s Without construct: 0.0093209743499756s
Output for 7.0.5
With construct: 0.022981882095337s Without construct: 0.012621879577637s
Output for 7.0.4
With construct: 0.02045202255249s Without construct: 0.013014078140259s
Output for 7.0.3
With construct: 0.0082700252532959s Without construct: 0.0057849884033203s
Output for 7.0.2
With construct: 0.010324001312256s Without construct: 0.0069589614868164s
Output for 7.0.1
With construct: 0.012699127197266s Without construct: 0.0084221363067627s
Output for 7.0.0
With construct: 0.012420892715454s Without construct: 0.0088849067687988s
Output for 5.6.28
With construct: 0.028218984603882s Without construct: 0.018334865570068s
Output for 5.6.26
With construct: 0.020370960235596s Without construct: 0.010766983032227s
Output for 5.6.25
With construct: 0.019471883773804s Without construct: 0.013890981674194s
Output for 5.6.24
With construct: 0.021484851837158s Without construct: 0.013741016387939s
Output for 5.6.23
With construct: 0.021814107894897s Without construct: 0.013879060745239s
Output for 5.6.22
With construct: 0.014656066894531s Without construct: 0.010252952575684s
Output for 5.6.21
With construct: 0.022625923156738s Without construct: 0.014091968536377s
Output for 5.6.20
With construct: 0.033308029174805s Without construct: 0.020993947982788s
Output for 5.6.19
With construct: 0.033734083175659s Without construct: 0.020373106002808s
Output for 5.6.18
With construct: 0.022693157196045s Without construct: 0.014657020568848s
Output for 5.6.17
With construct: 0.023508071899414s Without construct: 0.015047073364258s
Output for 5.6.16
With construct: 0.01642107963562s Without construct: 0.010519027709961s
Output for 5.6.15
With construct: 0.020984172821045s Without construct: 0.011332988739014s
Output for 5.6.14
With construct: 0.015060186386108s Without construct: 0.010371208190918s
Output for 5.6.13
With construct: 0.015458822250366s Without construct: 0.010315895080566s
Output for 5.6.12
With construct: 0.015159845352173s Without construct: 0.010460138320923s
Output for 5.6.11
With construct: 0.021243095397949s Without construct: 0.013893127441406s
Output for 5.6.10
With construct: 0.01597785949707s Without construct: 0.010854005813599s
Output for 5.6.9
With construct: 0.02678108215332s Without construct: 0.015908002853394s
Output for 5.6.8
With construct: 0.014271974563599s Without construct: 0.0094401836395264s
Output for 5.6.7
With construct: 0.034443140029907s Without construct: 0.011139869689941s
Output for 5.6.6
With construct: 0.015880107879639s Without construct: 0.010254859924316s
Output for 5.6.5
With construct: 0.01496410369873s Without construct: 0.010184049606323s
Output for 5.6.4
With construct: 0.014970064163208s Without construct: 0.010223150253296s
Output for 5.6.3
With construct: 0.022058010101318s Without construct: 0.012898921966553s
Output for 5.6.2
With construct: 0.021245002746582s Without construct: 0.012935876846313s
Output for 5.6.1
With construct: 0.018576145172119s Without construct: 0.012743949890137s
Output for 5.6.0
With construct: 0.016327857971191s Without construct: 0.010831117630005s
Output for 5.5.38
With construct: 0.023777961730957s Without construct: 0.016139984130859s
Output for 5.5.37
With construct: 0.016916990280151s Without construct: 0.011565208435059s
Output for 5.5.36
With construct: 0.021570920944214s Without construct: 0.015015840530396s
Output for 5.5.35
With construct: 0.015692949295044s Without construct: 0.011422157287598s
Output for 5.5.34
With construct: 0.022545099258423s Without construct: 0.015573978424072s
Output for 5.5.33
With construct: 0.017225027084351s Without construct: 0.012356042861938s
Output for 5.5.32
With construct: 0.024899959564209s Without construct: 0.016632080078125s
Output for 5.5.31
With construct: 0.021062850952148s Without construct: 0.014973878860474s
Output for 5.5.30
With construct: 0.017997026443481s Without construct: 0.012592077255249s
Output for 5.5.29
With construct: 0.017300128936768s Without construct: 0.013118028640747s
Output for 5.5.28
With construct: 0.025758028030396s Without construct: 0.016812086105347s
Output for 5.5.27
With construct: 0.018592119216919s Without construct: 0.012462854385376s
Output for 5.5.26
With construct: 0.017146110534668s Without construct: 0.011868953704834s
Output for 5.5.25
With construct: 0.015832185745239s Without construct: 0.012270212173462s
Output for 5.5.24
With construct: 0.016041994094849s Without construct: 0.011723041534424s
Output for 5.5.23
With construct: 0.022216081619263s Without construct: 0.015455961227417s
Output for 5.5.22
With construct: 0.02002215385437s Without construct: 0.013865947723389s
Output for 5.5.21
With construct: 0.017163991928101s Without construct: 0.011954069137573s
Output for 5.5.20
With construct: 0.018492937088013s Without construct: 0.012792825698853s
Output for 5.5.19
With construct: 0.022564172744751s Without construct: 0.015393018722534s
Output for 5.5.18
With construct: 0.026390075683594s Without construct: 0.014910936355591s
Output for 5.5.16
With construct: 0.015893936157227s Without construct: 0.011848926544189s
Output for 5.5.15
With construct: 0.015805006027222s Without construct: 0.011724948883057s
Output for 5.5.14
With construct: 0.020219802856445s Without construct: 0.01318883895874s
Output for 5.5.13
With construct: 0.015760898590088s Without construct: 0.011888027191162s
Output for 5.5.12
With construct: 0.016684055328369s Without construct: 0.01242995262146s
Output for 5.5.11
With construct: 0.016334056854248s Without construct: 0.01164698600769s
Output for 5.5.10
With construct: 0.018142223358154s Without construct: 0.012610912322998s
Output for 5.5.9
With construct: 0.027534008026123s Without construct: 0.016249895095825s
Output for 5.5.8
With construct: 0.025716066360474s Without construct: 0.017379999160767s
Output for 5.5.7
With construct: 0.018817901611328s Without construct: 0.013215065002441s
Output for 5.5.6
With construct: 0.023319959640503s Without construct: 0.015913009643555s
Output for 5.5.5
With construct: 0.024163007736206s Without construct: 0.016679048538208s
Output for 5.5.4
With construct: 0.021587133407593s Without construct: 0.015113115310669s
Output for 5.5.3
With construct: 0.016035079956055s Without construct: 0.011412143707275s
Output for 5.5.2
With construct: 0.027195930480957s Without construct: 0.015302896499634s
Output for 5.5.1
With construct: 0.016520977020264s Without construct: 0.011947870254517s
Output for 5.5.0
With construct: 0.022787094116211s Without construct: 0.015362977981567s
Output for 5.4.45
With construct: 0.023391008377075s Without construct: 0.013129949569702s
Output for 5.4.44
With construct: 0.014080047607422s Without construct: 0.0099248886108398s
Output for 5.4.43
With construct: 0.017053842544556s Without construct: 0.012500047683716s
Output for 5.4.42
With construct: 0.022629022598267s Without construct: 0.013041019439697s
Output for 5.4.41
With construct: 0.01712703704834s Without construct: 0.011865139007568s
Output for 5.4.40
With construct: 0.018170118331909s Without construct: 0.012822866439819s
Output for 5.4.39
With construct: 0.022902011871338s Without construct: 0.015205860137939s
Output for 5.4.38
With construct: 0.02280592918396s Without construct: 0.01503586769104s
Output for 5.4.37
With construct: 0.021242141723633s Without construct: 0.014988899230957s
Output for 5.4.36
With construct: 0.016726016998291s Without construct: 0.011178970336914s
Output for 5.4.35
With construct: 0.020015954971313s Without construct: 0.012863874435425s
Output for 5.4.34
With construct: 0.015965938568115s Without construct: 0.011453866958618s
Output for 5.4.32
With construct: 0.016407012939453s Without construct: 0.012057065963745s
Output for 5.4.31
With construct: 0.019684076309204s Without construct: 0.013969898223877s
Output for 5.4.30
With construct: 0.035432815551758s Without construct: 0.01350998878479s
Output for 5.4.29
With construct: 0.015666007995605s Without construct: 0.011932849884033s
Output for 5.4.28
With construct: 0.015897989273071s Without construct: 0.011743068695068s
Output for 5.4.27
With construct: 0.019748210906982s Without construct: 0.013972043991089s
Output for 5.4.26
With construct: 0.016760110855103s Without construct: 0.01275897026062s
Output for 5.4.25
With construct: 0.024864912033081s Without construct: 0.017040967941284s
Output for 5.4.24
With construct: 0.02643609046936s Without construct: 0.014503955841064s
Output for 5.4.23
With construct: 0.015598773956299s Without construct: 0.012332916259766s
Output for 5.4.22
With construct: 0.021265029907227s Without construct: 0.01729679107666s
Output for 5.4.21
With construct: 0.016375064849854s Without construct: 0.011887073516846s
Output for 5.4.20
With construct: 0.018979072570801s Without construct: 0.015985012054443s
Output for 5.4.19
With construct: 0.021286010742188s Without construct: 0.014540910720825s
Output for 5.4.18
With construct: 0.020272970199585s Without construct: 0.014083862304688s
Output for 5.4.17
With construct: 0.017590999603271s Without construct: 0.011702060699463s
Output for 5.4.16
With construct: 0.020930051803589s Without construct: 0.01453709602356s
Output for 5.4.15
With construct: 0.022898197174072s Without construct: 0.015451192855835s
Output for 5.4.14
With construct: 0.018210172653198s Without construct: 0.011959075927734s
Output for 5.4.13
With construct: 0.026746988296509s Without construct: 0.01859712600708s
Output for 5.4.12
With construct: 0.016677856445312s Without construct: 0.011778831481934s
Output for 5.4.11
With construct: 0.015974998474121s Without construct: 0.011461019515991s
Output for 5.4.10
With construct: 0.016919851303101s Without construct: 0.01200795173645s
Output for 5.4.9
With construct: 0.01661205291748s Without construct: 0.011770963668823s
Output for 5.4.8
With construct: 0.019647121429443s Without construct: 0.013656139373779s
Output for 5.4.7
With construct: 0.031084060668945s Without construct: 0.016844034194946s
Output for 5.4.6
With construct: 0.020236968994141s Without construct: 0.013906955718994s
Output for 5.4.5
With construct: 0.017898082733154s Without construct: 0.014003992080688s
Output for 5.4.4
With construct: 0.017308950424194s Without construct: 0.010552883148193s
Output for 5.4.3
With construct: 0.020464897155762s Without construct: 0.013679981231689s
Output for 5.4.2
With construct: 0.015376091003418s Without construct: 0.011825084686279s
Output for 5.4.1
With construct: 0.013983011245728s Without construct: 0.010684013366699s
Output for 5.4.0
With construct: 0.016463041305542s Without construct: 0.011888027191162s
Output for 5.3.29
With construct: 0.025957822799683s Without construct: 0.020514965057373s
Output for 5.3.28
With construct: 0.028134107589722s Without construct: 0.021748065948486s
Output for 5.3.27
With construct: 0.024896860122681s Without construct: 0.019787788391113s
Output for 5.3.26
With construct: 0.036196947097778s Without construct: 0.021366834640503s
Output for 5.3.25
With construct: 0.034972190856934s Without construct: 0.02567982673645s
Output for 5.3.24
With construct: 0.027190923690796s Without construct: 0.021198987960815s
Output for 5.3.23
With construct: 0.024061918258667s Without construct: 0.019425868988037s
Output for 5.3.22
With construct: 0.026583909988403s Without construct: 0.020304918289185s
Output for 5.3.21
With construct: 0.031821966171265s Without construct: 0.027971029281616s
Output for 5.3.20
With construct: 0.024466991424561s Without construct: 0.019688844680786s
Output for 5.3.19
With construct: 0.031666994094849s Without construct: 0.023144006729126s
Output for 5.3.18
With construct: 0.024094820022583s Without construct: 0.019841909408569s
Output for 5.3.17
With construct: 0.024026870727539s Without construct: 0.019479036331177s
Output for 5.3.16
With construct: 0.02606987953186s Without construct: 0.020235061645508s
Output for 5.3.15
With construct: 0.024542093276978s Without construct: 0.019879102706909s
Output for 5.3.14
With construct: 0.032995939254761s Without construct: 0.024762153625488s
Output for 5.3.13
With construct: 0.024749040603638s Without construct: 0.019887924194336s
Output for 5.3.12
With construct: 0.024720907211304s Without construct: 0.020153045654297s
Output for 5.3.11
With construct: 0.024872064590454s Without construct: 0.017590999603271s
Output for 5.3.10
With construct: 0.024235010147095s Without construct: 0.019383907318115s
Output for 5.3.9
With construct: 0.024756908416748s Without construct: 0.020421981811523s
Output for 5.3.8
With construct: 0.035259008407593s Without construct: 0.024842023849487s
Output for 5.3.7
With construct: 0.025499105453491s Without construct: 0.019953966140747s
Output for 5.3.6
With construct: 0.025155067443848s Without construct: 0.020111083984375s
Output for 5.3.5
With construct: 0.033849954605103s Without construct: 0.022688865661621s
Output for 5.3.4
With construct: 0.033652067184448s Without construct: 0.025303840637207s
Output for 5.3.3
With construct: 0.028772830963135s Without construct: 0.020926952362061s
Output for 5.3.2
With construct: 0.038367033004761s Without construct: 0.040369033813477s
Output for 5.3.1
With construct: 0.026870965957642s Without construct: 0.020879030227661s
Output for 5.3.0
With construct: 0.033307075500488s Without construct: 0.023247957229614s
Output for 5.2.17
With construct: 0.03069806098938s Without construct: 0.022179841995239s
Output for 5.2.16
With construct: 0.026863098144531s Without construct: 0.020992994308472s
Output for 5.2.15
With construct: 0.026229858398438s Without construct: 0.022350788116455s
Output for 5.2.14
With construct: 0.043036937713623s Without construct: 0.028806924819946s
Output for 5.2.13
With construct: 0.041100025177002s Without construct: 0.02844500541687s
Output for 5.2.12
With construct: 0.045907020568848s Without construct: 0.030817985534668s
Output for 5.2.11
With construct: 0.052477836608887s Without construct: 0.029652833938599s
Output for 5.2.10
With construct: 0.034407138824463s Without construct: 0.034161806106567s
Output for 5.2.9
With construct: 0.028198957443237s Without construct: 0.025632858276367s
Output for 5.2.8
With construct: 0.030622005462646s Without construct: 0.023027896881104s
Output for 5.2.7
With construct: 0.024543046951294s Without construct: 0.01848292350769s
Output for 5.2.6
With construct: 0.038758993148804s Without construct: 0.023797035217285s
Output for 5.2.5
With construct: 0.026793003082275s Without construct: 0.020911931991577s
Output for 5.2.4
With construct: 0.031024217605591s Without construct: 0.021498918533325s
Output for 5.2.3
With construct: 0.026799917221069s Without construct: 0.020805835723877s
Output for 5.2.2
With construct: 0.036238193511963s Without construct: 0.025869131088257s
Output for 5.2.1
With construct: 0.037038087844849s Without construct: 0.028120040893555s
Output for 5.2.0
With construct: 0.042666912078857s Without construct: 0.029169082641602s
Output for 5.1.6
With construct: 0.034394025802612s Without construct: 0.023385047912598s
Output for 5.1.5
With construct: 0.036298036575317s Without construct: 0.021761894226074s
Output for 5.1.4
With construct: 0.033011913299561s Without construct: 0.026099920272827s
Output for 5.1.3
With construct: 0.037921190261841s Without construct: 0.02112603187561s
Output for 5.1.2
With construct: 0.035140991210938s Without construct: 0.024142026901245s
Output for 5.1.1
With construct: 0.032853841781616s Without construct: 0.020102977752686s
Output for 5.1.0
With construct: 0.030266046524048s Without construct: 0.021133899688721s
Output for 5.0.5
With construct: 0.058733224868774s Without construct: 0.035865068435669s
Output for 5.0.4
With construct: 0.062836885452271s Without construct: 0.038191080093384s
Output for 5.0.3
With construct: 0.053714036941528s Without construct: 0.03499698638916s
Output for 5.0.2
With construct: 0.046360015869141s Without construct: 0.035331964492798s
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/fjDjR on line 19 With construct: 0.050437927246094sPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/fjDjR on line 25 Without construct: 0.030846834182739sPHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/fjDjR on line 19 With construct: 0.050091981887817sPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/fjDjR on line 25 Without construct: 0.029930830001831sPHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/fjDjR on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/fjDjR on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/fjDjR on line 5
Process exited with code 255.

preferences:
176.94 ms | 401 KiB | 234 Q