3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dt = new DateTimeImmutable('-2 hours'); $newDt = $dt->modify('+2 hours'); var_dump($dt->format('U')); var_dump($newDt->format('U')); var_dump($dt === $newDt);
Output for 5.6.28, 7.0.14 - 7.1.0
string(10) "1404552124" string(10) "1404559324" bool(false)
Output for 7.0.6
string(10) "1462221260" string(10) "1462228460" bool(false)
Output for 7.0.5
string(10) "1459591639" string(10) "1459598839" bool(false)
Output for 7.0.4
string(10) "1457553931" string(10) "1457561131" bool(false)
Output for 7.0.3
string(10) "1458246631" string(10) "1458253831" bool(false)
Output for 7.0.2
string(10) "1458544387" string(10) "1458551587" bool(false)
Output for 7.0.1
string(10) "1458715941" string(10) "1458723141" bool(false)
Output for 7.0.0
string(10) "1458986202" string(10) "1458993402" bool(false)
Output for hhvm-3.12.0
string(10) "1457653520" string(10) "1457660720" bool(false)
Output for hhvm-3.10.0
string(10) "1459257419" string(10) "1459264619" bool(false)
Output for 5.6.21
string(10) "1462117174" string(10) "1462124374" bool(false)
Output for 5.6.20
string(10) "1460179364" string(10) "1460186564" bool(false)
Output for 5.6.19
string(10) "1457285463" string(10) "1457292663" bool(false)
Output for 5.6.18
string(10) "1457935193" string(10) "1457942393" bool(false)
Output for 5.6.17
string(10) "1458349562" string(10) "1458356762" bool(false)
Output for 5.6.16
string(10) "1459075254" string(10) "1459082454" bool(false)
Output for 5.6.15
string(10) "1459165201" string(10) "1459172401" bool(false)
Output for 5.6.14
string(10) "1459520494" string(10) "1459527694" bool(false)
Output for 5.6.13
string(10) "1460657904" string(10) "1460665104" bool(false)
Output for 5.6.12
string(10) "1461050547" string(10) "1461057747" bool(false)
Output for 5.6.11
string(10) "1461336022" string(10) "1461343222" bool(false)
Output for 5.6.10
string(10) "1461514732" string(10) "1461521932" bool(false)
Output for 5.6.9
string(10) "1461705823" string(10) "1461713023" bool(false)
Output for 5.6.8
string(10) "1461905865" string(10) "1461913065" bool(false)
Output for 5.6.7
string(10) "1464101356" string(10) "1464108556" bool(false)
Output for 5.5.35
string(10) "1463856791" string(10) "1463863991" bool(false)
Output for 5.5.34
string(10) "1460286627" string(10) "1460293827" bool(false)
Output for 5.5.33
string(10) "1457421426" string(10) "1457428626" bool(false)
Output for 5.5.32
string(10) "1458058740" string(10) "1458065940" bool(false)
Output for 5.5.31
string(10) "1458446414" string(10) "1458453614" bool(false)
Output for 5.5.30
string(10) "1459431849" string(10) "1459439049" bool(false)
Output for 5.5.29
string(10) "1460794879" string(10) "1460802079" bool(false)
Output for 5.5.28
string(10) "1461148335" string(10) "1461155535" bool(false)
Output for 5.5.27
string(10) "1461244293" string(10) "1461251493" bool(false)
Output for 5.5.26
string(10) "1461609210" string(10) "1461616410" bool(false)
Output for 5.5.25
string(10) "1461804029" string(10) "1461811229" bool(false)
Output for 5.5.24
string(10) "1462004343" string(10) "1462011543" bool(false)
Output for 5.0.0 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/CQM2Y on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/CQM2Y on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimeimmutable in /in/CQM2Y on line 3