]> granicus.if.org Git - php/commitdiff
Remove example PHP script from FFI
authorPeter Kokot <peterkokot@gmail.com>
Sun, 5 May 2019 23:40:15 +0000 (01:40 +0200)
committerPeter Kokot <peterkokot@gmail.com>
Wed, 8 May 2019 19:55:59 +0000 (21:55 +0200)
FFI README.md already includes the PHP example with more information.

ext/ffi/example.php [deleted file]

diff --git a/ext/ffi/example.php b/ext/ffi/example.php
deleted file mode 100644 (file)
index 0b82e25..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-$ffi = FFI::cdef("
-
-    int printf(const char *format, ...);
-    const char * getenv(const char *);
-    unsigned int time(unsigned int *);
-
-    typedef unsigned int time_t;
-    typedef unsigned int suseconds_t;
-
-    struct timeval {
-        time_t      tv_sec;
-        suseconds_t tv_usec;
-    };
-
-    struct timezone {
-        int tz_minuteswest;
-        int tz_dsttime;
-    };
-
-       int gettimeofday(struct timeval *tv, struct timezone *tz);
-    ", "libc.so.6");
-
-var_dump($ffi->printf("Hello World from %s!\n", "PHP"));
-var_dump($ffi->getenv("PATH"));
-var_dump($ffi->time(null));
-
-$tv = $ffi->new("struct timeval");
-$tz = $ffi->new("struct timezone");
-var_dump($ffi->gettimeofday(FFI::addr($tv), FFI::addr($tz)));
-var_dump($tv, $tz);