3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sMicrotime = microtime(true); $sMsgId = preg_replace('/^.+\./', '', $sMicrotime); $sDatetime = date('YmdHis').str_pad(preg_replace('/^.+\./', '', $sMicrotime), 4, '0', STR_PAD_RIGHT); echo '<pre>'; var_dump($sMicrotime); var_dump($sMsgId); var_dump($sDatetime); echo '</pre>';
Output for 5.4.17, 5.4.24 - 5.4.25, 5.4.29 - 5.4.30, 5.4.34, 5.6.6, 7.0.4 - 7.0.5, 7.0.14 - 7.1.0
<pre>float(1391394220.0037) string(4) "0037" string(18) "201402030323400037" </pre>
Output for 5.4.15, 5.4.42, 5.5.0, 5.5.27, 5.5.33, 5.5.35, 5.6.1, 5.6.23, 7.0.8
<pre>float(1391394220.0039) string(4) "0039" string(18) "201402030323400039" </pre>
Output for 5.4.22, 7.0.1, 7.0.7
<pre>float(1391394220.0034) string(4) "0034" string(18) "201402030323400034" </pre>
Output for 7.0.6
<pre>float(1391394220.0031) string(4) "0031" string(18) "201402030323400031" </pre>
Output for 5.4.16, 5.4.20, 5.4.35, 5.5.5, 5.5.9, 5.5.13, 5.6.14, 7.0.3
<pre>float(1391394220.0041) string(4) "0041" string(18) "201402030323400041" </pre>
Output for 5.4.27, 5.6.8, 7.0.2
<pre>float(1391394220.0029) string(4) "0029" string(18) "201402030323400029" </pre>
Output for 5.4.18, 5.4.26, 5.4.38, 5.5.19, 5.6.17, 7.0.0
<pre>float(1391394220.0035) string(4) "0035" string(18) "201402030323400035" </pre>
Output for 5.5.29, 5.5.31, 5.5.37, 5.6.10, 5.6.28
<pre>float(1391394220.0045) string(4) "0045" string(18) "201402030323400045" </pre>
Output for 5.5.6, 5.5.10, 5.5.15, 5.6.2, 5.6.9, 5.6.19, 5.6.22
<pre>float(1391394220.0048) string(4) "0048" string(18) "201402030323400048" </pre>
Output for 5.5.22 - 5.5.23, 5.5.26, 5.6.21
<pre>float(1391394220.0046) string(4) "0046" string(18) "201402030323400046" </pre>
Output for 5.4.21, 5.5.16 - 5.5.18, 5.5.21, 5.5.24, 5.6.0, 5.6.20
<pre>float(1391394220.0036) string(4) "0036" string(18) "201402030323400036" </pre>
Output for 5.6.18
<pre>float(1391394220.0032) string(4) "0032" string(18) "201402030323400032" </pre>
Output for 5.4.32, 5.4.37, 5.6.16
<pre>float(1391394220.0033) string(4) "0033" string(18) "201402030323400033" </pre>
Output for 5.6.15
<pre>float(1391394220.0054) string(4) "0054" string(18) "201402030323400054" </pre>
Output for 5.2.0, 5.6.7, 5.6.13
<pre>float(1391394220.003) string(3) "003" string(18) "201402030323400030" </pre>
Output for 5.4.28, 5.4.45, 5.5.2, 5.5.25, 5.6.5, 5.6.12
<pre>float(1391394220.004) string(3) "004" string(18) "201402030323400040" </pre>
Output for 5.6.11
<pre>float(1391394220.0052) string(4) "0052" string(18) "201402030323400052" </pre>
Output for 5.4.36, 5.5.1, 5.5.8, 5.5.30, 5.5.34, 5.6.4
<pre>float(1391394220.0044) string(4) "0044" string(18) "201402030323400044" </pre>
Output for 5.4.19, 5.5.7, 5.6.3
<pre>float(1391394220.0049) string(4) "0049" string(18) "201402030323400049" </pre>
Output for 5.5.11, 5.5.14, 5.5.32, 5.5.36
<pre>float(1391394220.0043) string(4) "0043" string(18) "201402030323400043" </pre>
Output for 5.5.12, 5.5.28
<pre>float(1391394220.0047) string(4) "0047" string(18) "201402030323400047" </pre>
Output for 5.5.20
<pre>float(1391394220.005) string(3) "005" string(18) "201402030323400050" </pre>
Output for 5.5.4
<pre>float(1391394220.0051) string(4) "0051" string(18) "201402030323400051" </pre>
Output for 5.5.3
<pre>float(1391394220.0042) string(4) "0042" string(18) "201402030323400042" </pre>
Output for 5.4.23, 5.4.31, 5.4.41, 5.4.44
<pre>float(1391394220.0038) string(4) "0038" string(18) "201402030323400038" </pre>
Output for 5.4.40, 5.4.43
<pre>float(1391394220.0027) string(4) "0027" string(18) "201402030323400027" </pre>
Output for 5.4.39
<pre>float(1391394220.0028) string(4) "0028" string(18) "201402030323400028" </pre>
Output for 5.3.0, 5.3.2, 5.3.12, 5.4.0 - 5.4.2, 5.4.5 - 5.4.6, 5.4.9, 5.4.13 - 5.4.14
<pre>float(1391394220.0022) string(4) "0022" string(18) "201402030323400022" </pre>
Output for 5.2.7, 5.2.10, 5.3.1, 5.3.8, 5.4.10, 5.4.12
<pre>float(1391394220.002) string(3) "002" string(18) "201402030323400020" </pre>
Output for 5.1.6, 5.3.14, 5.3.23, 5.4.11
<pre>float(1391394220.0019) string(4) "0019" string(18) "201402030323400019" </pre>
Output for 5.2.1, 5.2.8, 5.2.11 - 5.2.13, 5.3.3, 5.4.3 - 5.4.4, 5.4.7 - 5.4.8
<pre>float(1391394220.0018) string(4) "0018" string(18) "201402030323400018" </pre>
Output for 5.3.16, 5.3.18, 5.3.21 - 5.3.22, 5.3.24, 5.3.29
<pre>float(1391394220.0021) string(4) "0021" string(18) "201402030323400021" </pre>
Output for 5.2.16, 5.3.13, 5.3.19 - 5.3.20, 5.3.26, 5.3.28
<pre>float(1391394220.0024) string(4) "0024" string(18) "201402030323400024" </pre>
Output for 5.3.4 - 5.3.5, 5.3.9, 5.3.11, 5.3.15, 5.3.17, 5.3.25, 5.3.27
<pre>float(1391394220.0023) string(4) "0023" string(18) "201402030323400023" </pre>
Output for 5.1.3 - 5.1.5, 5.2.5 - 5.2.6, 5.2.9, 5.2.15, 5.3.6, 5.3.10
<pre>float(1391394220.0017) string(4) "0017" string(18) "201402030323400017" </pre>
Output for 5.3.7
<pre>float(1391394220.0026) string(4) "0026" string(18) "201402030323400026" </pre>
Output for 5.1.2, 5.2.4, 5.2.17
<pre>float(1391394220.0015) string(4) "0015" string(18) "201402030323400015" </pre>
Output for 5.1.1, 5.2.3, 5.2.14
<pre>float(1391394220.0016) string(4) "0016" string(18) "201402030323400016" </pre>
Output for 5.2.2
<pre>float(1391394220.0013) string(4) "0013" string(18) "201402030323400013" </pre>
Output for 5.1.0
<pre>float(1391394220.0014) string(4) "0014" string(18) "201402030323400014" </pre>
Output for 5.0.5
<pre>float(1391394220.0005) string(4) "0005" string(18) "201402030323400005" </pre>
Output for 5.0.0 - 5.0.1, 5.0.3 - 5.0.4
<pre>float(1391394220.0007) string(4) "0007" string(18) "201402030323400007" </pre>
Output for 5.0.2
<pre>float(1391394220.0006) string(4) "0006" string(18) "201402030323400006" </pre>
Output for 4.4.9
<pre>string(21) "0.00011100 1391394220" string(19) "00011100 1391394220" string(33) "2014020303234000011100 1391394220" </pre>
Output for 4.4.8
<pre>string(21) "0.00012000 1391394220" string(19) "00012000 1391394220" string(33) "2014020303234000012000 1391394220" </pre>
Output for 4.4.0, 4.4.2, 4.4.6 - 4.4.7
<pre>string(21) "0.00011900 1391394220" string(19) "00011900 1391394220" string(33) "2014020303234000011900 1391394220" </pre>
Output for 4.4.5
<pre>string(21) "0.00009000 1391394220" string(19) "00009000 1391394220" string(33) "2014020303234000009000 1391394220" </pre>
Output for 4.4.4
<pre>string(21) "0.00010900 1391394220" string(19) "00010900 1391394220" string(33) "2014020303234000010900 1391394220" </pre>
Output for 4.3.4, 4.4.3
<pre>string(21) "0.00011400 1391394220" string(19) "00011400 1391394220" string(33) "2014020303234000011400 1391394220" </pre>
Output for 4.4.1
<pre>string(21) "0.00008800 1391394220" string(19) "00008800 1391394220" string(33) "2014020303234000008800 1391394220" </pre>
Output for 4.3.11
<pre>string(21) "0.00011600 1391394220" string(19) "00011600 1391394220" string(33) "2014020303234000011600 1391394220" </pre>
Output for 4.3.10
<pre>string(21) "0.00010400 1391394220" string(19) "00010400 1391394220" string(33) "2014020303234000010400 1391394220" </pre>
Output for 4.3.9
<pre>string(21) "0.00014300 1391394220" string(19) "00014300 1391394220" string(33) "2014020303234000014300 1391394220" </pre>
Output for 4.3.8
<pre>string(21) "0.00011200 1391394220" string(19) "00011200 1391394220" string(33) "2014020303234000011200 1391394220" </pre>
Output for 4.3.7
<pre>string(21) "0.00012800 1391394220" string(19) "00012800 1391394220" string(33) "2014020303234000012800 1391394220" </pre>
Output for 4.3.6
<pre>string(21) "0.00013100 1391394220" string(19) "00013100 1391394220" string(33) "2014020303234000013100 1391394220" </pre>
Output for 4.3.5
<pre>string(21) "0.00012400 1391394220" string(19) "00012400 1391394220" string(33) "2014020303234000012400 1391394220" </pre>
Output for 4.3.3
<pre>string(21) "0.00015300 1391394220" string(19) "00015300 1391394220" string(33) "2014020303234000015300 1391394220" </pre>
Output for 4.3.2
<pre>string(21) "0.00013300 1391394220" string(19) "00013300 1391394220" string(33) "2014020303234000013300 1391394220" </pre>
Output for 4.3.1
<pre>string(21) "0.00013500 1391394220" string(19) "00013500 1391394220" string(33) "2014020303234000013500 1391394220" </pre>
Output for 4.3.0
<pre>string(21) "0.00012700 1391394220" string(19) "00012700 1391394220" string(33) "2014020303234000012700 1391394220" </pre>