/ hrtime (from dev using PHP 7.3.28-buster)

FROM php:7.3.28-buster
RUN apt update && \
    apt install -y --no-install-recommends git subversion autoconf build-essential && \
    rm -rf /var/lib/apt/lists/*
RUN svn checkout --revision HEAD /tmp/ext-src && \
    cd /tmp/ext-src/trunk && \
    phpize && \
    ./configure --enable-hrtime && \
    make && \
    make test
Build output FAIL 80ss
Step 1/4 : FROM php:7.3.28-buster
---> 8268e20fdcaa
Step 2/4 : WORKDIR /tmp
---> Running in f3893c1cc346
Removing intermediate container f3893c1cc346
---> 623f02c41e94
Step 3/4 : RUN apt update && apt install -y --no-install-recommends git subversion autoconf build-essential && rm -rf /var/lib/apt/lists/*
---> Running in 5013e7a5180b

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 buster/updates InRelease [65.4 kB]
Get:2 buster InRelease [121 kB]
Get:3 buster-updates InRelease [51.9 kB]
Get:4 buster/updates/main amd64 Packages [285 kB]
Get:5 buster/main amd64 Packages [7907 kB]
Get:6 buster-updates/main amd64 Packages [10.9 kB]
Fetched 8441 kB in 1s (5785 kB/s)
Reading package lists...
Building dependency tree...
Reading state information...
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

does not have a stable CLI interface. 
Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
autoconf is already the newest version (2.69-11).
The following package was automatically installed and is no longer required:
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
git-man libapr1 libaprutil1 libcurl3-gnutls liberror-perl libexpat1
libpcre2-8-0 libserf-1-1 libsvn1 libutf8proc2
Suggested packages:
gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email
git-gui gitk gitweb git-cvs git-mediawiki git-svn db5.3-util
libapache2-mod-svn subversion-tools
Recommended packages:
less ssh-client
The following NEW packages will be installed:
build-essential git git-man libapr1 libaprutil1 libcurl3-gnutls
liberror-perl libexpat1 libpcre2-8-0 libserf-1-1 libsvn1 libutf8proc2
0 upgraded, 13 newly installed, 0 to remove and 2 not upgraded.
Need to get 10.7 MB of archives.
After this operation, 50.2 MB of additional disk space will be used.
Get:1 buster/updates/main amd64 libcurl3-gnutls amd64 7.64.0-4+deb10u2 [330 kB]
Get:2 buster/main amd64 build-essential amd64 12.6 [7576 B]
Get:3 buster/main amd64 libexpat1 amd64 2.2.6-2+deb10u1 [106 kB]
Get:4 buster/main amd64 libpcre2-8-0 amd64 10.32-5 [213 kB]
Get:5 buster/main amd64 liberror-perl all 0.17027-2 [30.9 kB]
Get:6 buster/main amd64 git-man all 1:2.20.1-2+deb10u3 [1620 kB]
Get:7 buster/main amd64 git amd64 1:2.20.1-2+deb10u3 [5633 kB]
Get:8 buster/main amd64 libapr1 amd64 1.6.5-1+b1 [102 kB]
Get:9 buster/main amd64 libaprutil1 amd64 1.6.1-4 [91.8 kB]
Get:10 buster/main amd64 libserf-1-1 amd64 1.3.9-7+b10 [53.6 kB]
Get:11 buster/main amd64 libutf8proc2 amd64 2.3.0-1 [53.0 kB]
Get:12 buster/main amd64 libsvn1 amd64 1.10.4-1+deb10u2 [1403 kB]
Get:13 buster/main amd64 subversion amd64 1.10.4-1+deb10u2 [1008 kB]
debconf: delaying package configuration, since apt-utils is not installed

Fetched 10.7 MB in 0s (90.6 MB/s)
Selecting previously unselected package build-essential.
(Reading database ...
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ...
12684 files and directories currently installed.)
Preparing to unpack .../00-build-essential_12.6_amd64.deb ...
Unpacking build-essential (12.6) ...
Selecting previously unselected package libcurl3-gnutls:amd64.
Preparing to unpack .../01-libcurl3-gnutls_7.64.0-4+deb10u2_amd64.deb ...
Unpacking libcurl3-gnutls:amd64 (7.64.0-4+deb10u2) ...
Selecting previously unselected package libexpat1:amd64.
Preparing to unpack .../02-libexpat1_2.2.6-2+deb10u1_amd64.deb ...
Unpacking libexpat1:amd64 (2.2.6-2+deb10u1) ...
Selecting previously unselected package libpcre2-8-0:amd64.
Preparing to unpack .../03-libpcre2-8-0_10.32-5_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.32-5) ...
Selecting previously unselected package liberror-perl.
Preparing to unpack .../04-liberror-perl_0.17027-2_all.deb ...
Unpacking liberror-perl (0.17027-2) ...
Selecting previously unselected package git-man.
Preparing to unpack .../05-git-man_1%3a2.20.1-2+deb10u3_all.deb ...
Unpacking git-man (1:2.20.1-2+deb10u3) ...
Selecting previously unselected package git.
Preparing to unpack .../06-git_1%3a2.20.1-2+deb10u3_amd64.deb ...
Unpacking git (1:2.20.1-2+deb10u3) ...
Selecting previously unselected package libapr1:amd64.
Preparing to unpack .../07-libapr1_1.6.5-1+b1_amd64.deb ...
Unpacking libapr1:amd64 (1.6.5-1+b1) ...
Selecting previously unselected package libaprutil1:amd64.
Preparing to unpack .../08-libaprutil1_1.6.1-4_amd64.deb ...
Unpacking libaprutil1:amd64 (1.6.1-4) ...
Selecting previously unselected package libserf-1-1:amd64.
Preparing to unpack .../09-libserf-1-1_1.3.9-7+b10_amd64.deb ...
Unpacking libserf-1-1:amd64 (1.3.9-7+b10) ...
Selecting previously unselected package libutf8proc2:amd64.
Preparing to unpack .../10-libutf8proc2_2.3.0-1_amd64.deb ...
Unpacking libutf8proc2:amd64 (2.3.0-1) ...
Selecting previously unselected package libsvn1:amd64.
Preparing to unpack .../11-libsvn1_1.10.4-1+deb10u2_amd64.deb ...
Unpacking libsvn1:amd64 (1.10.4-1+deb10u2) ...
Selecting previously unselected package subversion.
Preparing to unpack .../12-subversion_1.10.4-1+deb10u2_amd64.deb ...
Unpacking subversion (1.10.4-1+deb10u2) ...
Setting up libexpat1:amd64 (2.2.6-2+deb10u1) ...
Setting up libutf8proc2:amd64 (2.3.0-1) ...
Setting up libapr1:amd64 (1.6.5-1+b1) ...
Setting up libcurl3-gnutls:amd64 (7.64.0-4+deb10u2) ...
Setting up liberror-perl (0.17027-2) ...
Setting up libpcre2-8-0:amd64 (10.32-5) ...
Setting up build-essential (12.6) ...
Setting up git-man (1:2.20.1-2+deb10u3) ...
Setting up libaprutil1:amd64 (1.6.1-4) ...
Setting up libserf-1-1:amd64 (1.3.9-7+b10) ...
Setting up git (1:2.20.1-2+deb10u3) ...
Setting up libsvn1:amd64 (1.10.4-1+deb10u2) ...
Setting up subversion (1.10.4-1+deb10u2) ...
Processing triggers for libc-bin (2.28-10) ...
Removing intermediate container 5013e7a5180b
---> 8dce52e38534
Step 4/4 : RUN svn checkout --revision HEAD /tmp/ext-src && cd /tmp/ext-src/trunk && phpize && ./configure --enable-hrtime && make && make test
---> Running in a3294b845149
A    ext-src/trunk
A    ext-src/trunk/tests
A    ext-src/tags
A    ext-src/tags/release_0.6.0
A    ext-src/tags/release_0.6.0/tests
A    ext-src/tags/release_0.5.1
A    ext-src/tags/release_0.5.1/tests
A    ext-src/trunk/hrtime.c
A    ext-src/trunk/package.xml
A    ext-src/trunk/php_hrtime.h
A    ext-src/trunk/tests/007.phpt
A    ext-src/tags/release_0.6.0/tests/002.phpt
A    ext-src/trunk/tests/001.phpt
A    ext-src/tags/release_0.6.0/LICENSE
A    ext-src/trunk/tests/004.phpt
A    ext-src/tags/release_0.6.0/
A    ext-src/tags/release_0.5.1/hrtime.c
A    ext-src/trunk/tests/
A    ext-src/tags/release_0.5.1/CREDITS
A    ext-src/tags/release_0.6.0/config.w32
A    ext-src/trunk/tests/002.phpt
A    ext-src/tags/release_0.5.1/tests/007.phpt
A    ext-src/tags/release_0.6.0/tests/005.phpt
A    ext-src/tags/release_0.5.0
A    ext-src/tags/release_0.5.0/tests
A    ext-src/trunk/tests/003.phpt
A    ext-src/tags/release_0.6.0/tests/007.phpt
A    ext-src/trunk/tests/005.phpt
A    ext-src/tags/release_0.6.0/tests/001.phpt
A    ext-src/trunk/tests/006.phpt
A    ext-src/trunk/config.m4
A    ext-src/tags/release_0.6.0/tests/004.phpt
A    ext-src/trunk/timer.h
A    ext-src/tags/release_0.5.1/.svnignore
A    ext-src/trunk/LICENSE
A    ext-src/tags/release_0.5.1/
A    ext-src/tags/release_0.5.1/tests/002.phpt
A    ext-src/tags/release_0.5.1/tests/003.phpt
A    ext-src/tags/release_0.5.1/timer.c
A    ext-src/tags/release_0.5.1/tests/006.phpt
A    ext-src/tags/release_0.5.1/LICENSE
A    ext-src/tags/release_0.5.1/tests/001.phpt
A    ext-src/trunk/.svnignore
A    ext-src/tags/release_0.5.0/tests/005.phpt
A    ext-src/tags/release_0.5.1/tests/005.phpt
A    ext-src/tags/release_0.4.3
A    ext-src/tags/release_0.5.0/timer.c
A    ext-src/trunk/CREDITS
A    ext-src/tags/release_0.5.1/php_hrtime.h
A    ext-src/trunk/config.w32
A    ext-src/trunk/timer.c
A    ext-src/tags/release_0.4.3/tests
A    ext-src/tags/release_0.5.0/tests/
A    ext-src/tags/release_0.5.0/tests/007.phpt
A    ext-src/tags/release_0.5.0/tests/001.phpt
A    ext-src/trunk/
A    ext-src/tags/release_0.5.0/tests/004.phpt
A    ext-src/tags/release_0.5.0/tests/003.phpt
A    ext-src/tags/release_0.5.0/LICENSE
A    ext-src/tags/release_0.6.0/config.m4
A    ext-src/tags/release_0.6.0/php_hrtime.h
A    ext-src/tags/release_0.5.0/timer.h
A    ext-src/tags/release_0.5.0/.svnignore
A    ext-src/tags/release_0.6.0/timer.h
A    ext-src/tags/release_0.5.0/php_hrtime.h
A    ext-src/branches
A    ext-src/tags/release_0.5.0/
A    ext-src/tags/release_0.6.0/.svnignore
A    ext-src/tags/release_0.5.0/package.xml
A    ext-src/tags/release_0.4.3/CREDITS
A    ext-src/tags/release_0.6.0/hrtime.c
A    ext-src/tags/release_0.5.0/CREDITS
A    ext-src/tags/release_0.4.3/
A    ext-src/tags/release_0.6.0/package.xml
A    ext-src/tags/release_0.4.3/config.w32
A    ext-src/tags/release_0.6.0/CREDITS
A    ext-src/tags/release_0.4.3/tests/002.phpt
A    ext-src/tags/release_0.4.3/tests/001.phpt
A    ext-src/tags/release_0.4.3/tests/
A    ext-src/tags/release_0.6.0/timer.c
A    ext-src/tags/release_0.4.3/tests/005.phpt
A    ext-src/tags/release_0.4.3/tests/004.phpt
A    ext-src/tags/release_0.4.3/tests/006.phpt
A    ext-src/tags/release_0.6.0/tests/006.phpt
A    ext-src/tags/release_0.4.3/php_hrtime.h
A    ext-src/tags/release_0.4.3/config.m4
A    ext-src/tags/release_0.4.3/timer.h
A    ext-src/tags/release_0.6.0/tests/
A    ext-src/tags/release_0.4.3/hrtime.c
A    ext-src/tags/release_0.6.0/tests/003.phpt
A    ext-src/tags/release_0.4.3/package.xml
A    ext-src/tags/release_0.5.1/timer.h
A    ext-src/tags/release_0.5.1/package.xml
A    ext-src/tags/release_0.5.1/config.w32
A    ext-src/tags/release_0.5.1/tests/
A    ext-src/tags/release_0.5.1/tests/004.phpt
A    ext-src/tags/release_0.5.1/config.m4
A    ext-src/tags/release_0.5.0/tests/006.phpt
A    ext-src/tags/release_0.5.0/tests/002.phpt
A    ext-src/tags/release_0.5.0/config.m4
A    ext-src/tags/release_0.5.0/hrtime.c
A    ext-src/tags/release_0.5.0/config.w32
A    ext-src/tags/release_0.4.3/timer.c
A    ext-src/tags/release_0.4.3/tests/003.phpt
A    ext-src/tags/release_0.4.3/LICENSE
A    ext-src/tags/release_0.4.3/.svnignore
Checked out revision 352318.
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731
checking for grep that handles long lines and -e...
checking for egrep...
/bin/grep -E
checking for a sed that does not truncate output...
checking for cc...
checking whether the C compiler works...
checking for C compiler default output file name...
checking for suffix of executables...
checking whether we are cross compiling...
checking for suffix of object files...
checking whether we are using the GNU C compiler...
checking whether cc accepts -g...
checking for cc option to accept ISO C89...
none needed
checking how to run the C preprocessor...
cc -E
checking for icc...
checking for suncc...
checking whether cc understands -c and -o together...
checking for system library directory...
checking if compiler supports -R...
checking if compiler supports -Wl,-rpath,...
checking build system type...
checking host system type...
checking target system type...
checking for PHP prefix...
checking for PHP includes...
-I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory...
checking for PHP installed headers prefix...
checking if debug is enabled...
checking if zts is enabled...
checking for re2c...
checking for re2c version...
1.1.1 (ok)
checking for gawk...
checking for nawk...
checking if nawk is broken...
checking whether to enable hrtime support...
yes, shared
checking for ld used by cc...
checking if the linker (/usr/bin/ld) is GNU ld...
checking for /usr/bin/ld option to reload object files...
checking for BSD-compatible nm...
/usr/bin/nm -B
checking whether ln -s works...
checking how to recognize dependent libraries...
checking for ANSI C header files...
checking for sys/types.h...
checking for sys/stat.h...
checking for stdlib.h...
checking for string.h...
checking for memory.h...
checking for strings.h...
checking for inttypes.h...
checking for stdint.h...
checking for unistd.h...
checking dlfcn.h usability...
checking dlfcn.h presence...
checking for dlfcn.h...
checking the maximum length of command line arguments...
checking command to parse /usr/bin/nm -B output from cc object...
checking for objdir...
checking for ar...
checking for ranlib...
checking for strip...
checking if cc supports -fno-rtti -fno-exceptions...
checking for cc option to produce PIC...
checking if cc PIC flag -fPIC works...
checking if cc static flag -static works...
checking if cc supports -c -o file.o...
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries...
checking whether -lc should be explicitly linked in...
checking dynamic linker characteristics...
checking how to hardcode library paths into programs...
checking whether stripping libraries is possible...
checking if libtool supports shared libraries...
checking whether to build shared libraries...
checking whether to build static libraries...
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
/bin/bash /tmp/ext-src/trunk/libtool --mode=compile cc  -I. -I/tmp/ext-src/trunk -DPHP_ATOM_INC -I/tmp/ext-src/trunk/include -I/tmp/ext-src/trunk/main -I/tmp/ext-src/trunk -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/ext-src/trunk/hrtime.c -o hrtime.lo
mkdir .libs
cc -I. -I/tmp/ext-src/trunk -DPHP_ATOM_INC -I/tmp/ext-src/trunk/include -I/tmp/ext-src/trunk/main -I/tmp/ext-src/trunk -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/ext-src/trunk/hrtime.c  -fPIC -DPIC -o .libs/hrtime.o
/bin/bash /tmp/ext-src/trunk/libtool --mode=compile cc  -I. -I/tmp/ext-src/trunk -DPHP_ATOM_INC -I/tmp/ext-src/trunk/include -I/tmp/ext-src/trunk/main -I/tmp/ext-src/trunk -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/ext-src/trunk/timer.c -o timer.lo
cc -I. -I/tmp/ext-src/trunk -DPHP_ATOM_INC -I/tmp/ext-src/trunk/include -I/tmp/ext-src/trunk/main -I/tmp/ext-src/trunk -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/ext-src/trunk/timer.c  -fPIC -DPIC -o .libs/timer.o
/bin/bash /tmp/ext-src/trunk/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/ext-src/trunk/include -I/tmp/ext-src/trunk/main -I/tmp/ext-src/trunk -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2    -o -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/ext-src/trunk/modules  hrtime.lo timer.lo -lrt
cc -shared  .libs/hrtime.o .libs/timer.o  -lrt  -Wl,-soname -Wl, -o .libs/
(cd .libs && rm -f && ln -s ../
/bin/bash /tmp/ext-src/trunk/libtool --mode=install cp ./ /tmp/ext-src/trunk/modules
cp ./.libs/ /tmp/ext-src/trunk/modules/
cp ./.libs/hrtime.lai /tmp/ext-src/trunk/modules/
PATH="$PATH:/sbin" ldconfig -n /tmp/ext-src/trunk/modules
Libraries have been installed in:
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and manual pages.
Build complete.
Don't forget to run 'make test'.
Build complete.
Don't forget to run 'make test'.
PHP         : /usr/local/bin/php 
PHP_SAPI    : cli
PHP_VERSION : 7.3.28
PHP_OS      : Linux - Linux a3294b845149 5.8.0-50-generic #56-Ubuntu SMP Mon Apr 12 17:18:36 UTC 2021 x86_64
INI actual  : /tmp/ext-src/trunk/tmp-php.ini
More .INIs  :   
PHP         : /usr/local/bin/phpdbg 
PHP_SAPI    : phpdbg
PHP_VERSION : 7.3.28
PHP_OS      : Linux - Linux a3294b845149 5.8.0-50-generic #56-Ubuntu SMP Mon Apr 12 17:18:36 UTC 2021 x86_64
INI actual  : /tmp/ext-src/trunk/tmp-php.ini
More .INIs  : 
CWD         : /tmp/ext-src/trunk
Extra dirs  :
VALGRIND    : Not used
TIME START 2021-04-29 23:57:13
TEST 1/7 [tests/001.phpt]
PASS HRTime\StopWatch lasts not more that microtime() [tests/001.phpt]
TEST 2/7 [tests/002.phpt]
PASS HRTime\StopWatch partial elapsed ticks sum == total elapsed ticks [tests/002.phpt]
TEST 3/7 [tests/003.phpt]
PASS HRTime\StopWatch is fine with sleep [tests/003.phpt] 
TEST 4/7 [tests/004.phpt]
PASS HRTime\StopWatch is fine with usleep [tests/004.phpt]
TEST 5/7 [tests/005.phpt]
PASS HRTime\StopWatch elapsed tick count vs. elapsed time [tests/005.phpt]
TEST 6/7 [tests/006.phpt]
PASS HRTime\StopWatch start right after stop with nanosecond resolution > 0 [tests/006.phpt]
TEST 7/7 [tests/007.phpt]
FAIL HRTime\StopWatch long test microtime comparsion [tests/007.phpt]
TIME END 2021-04-29 23:58:22
Exts skipped    :    0
Exts tested     :   33

Number of tests :    7                 7
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :    1 ( 14.3%) ( 14.3%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    6 ( 85.7%) ( 85.7%)
Time taken      :   69 seconds

HRTime\StopWatch long test microtime comparsion [tests/007.phpt]
You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at and
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.	You can then email it to [email protected] later.
Do you want to send this report now? [Yns]:
Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text):
Posting to
make: *** [Makefile:134: test] Error 1