summaryrefslogtreecommitdiffstats
path: root/stomp-php8.patch
blob: 46b1f0968b1690ad8453a4af6d947915d4cfd673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
From 7b066620afe3368662e316e86242d0087de8a44e Mon Sep 17 00:00:00 2001
From: Peter Kokot <peterkokot@gmail.com>
Date: Sat, 30 Jun 2018 16:44:34 +0200
Subject: [PATCH] Remove unused Git attributes ident

The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifes handling of $Id$ keywords by removing them since
they are not used anymore.
---
 config.m4   | 1 -
 config.w32  | 1 -
 php_stomp.c | 2 --
 php_stomp.h | 2 --
 stomp.c     | 2 --
 stomp.h     | 2 --
 6 files changed, 10 deletions(-)

diff --git a/config.m4 b/config.m4
index 8a9c36b..f700f27 100644
--- a/config.m4
+++ b/config.m4
@@ -1,4 +1,3 @@
-dnl $Id$
 dnl config.m4 for extension stomp
 
 PHP_ARG_ENABLE(stomp, whether to enable stomp support,
diff --git a/config.w32 b/config.w32
index 091e00b..ba3096b 100644
--- a/config.w32
+++ b/config.w32
@@ -1,4 +1,3 @@
-// $Id$
 // vim:ft=javascript
 
 ARG_ENABLE("stomp", "enable stomp support", "no");
diff --git a/php_stomp.c b/php_stomp.c
index 9442011..080298f 100644
--- a/php_stomp.c
+++ b/php_stomp.c
@@ -16,8 +16,6 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id$ */
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/php_stomp.h b/php_stomp.h
index b799119..805b9f6 100644
--- a/php_stomp.h
+++ b/php_stomp.h
@@ -16,8 +16,6 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id$ */
-
 #ifndef PHP_STOMP_H
 #define PHP_STOMP_H
 
diff --git a/stomp.c b/stomp.c
index 2f71606..d83a4e6 100644
--- a/stomp.c
+++ b/stomp.c
@@ -16,8 +16,6 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id$ */
-
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
diff --git a/stomp.h b/stomp.h
index a47787f..19bd8dd 100644
--- a/stomp.h
+++ b/stomp.h
@@ -16,8 +16,6 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id$ */
-
 #ifndef _STOMP_H_
 #define _STOMP_H_
 

From 684706756972bb75fec025ec9d66c3fc99ed5199 Mon Sep 17 00:00:00 2001
From: Peter Kokot <peterkokot@gmail.com>
Date: Wed, 3 Oct 2018 09:43:57 +0200
Subject: [PATCH] Trim trailing whitespace

---
 LICENSE                         |  26 ++++-----
 README                          |   2 +-
 TODO                            |   2 +-
 config.m4                       |   2 +-
 doc/classes.php                 |  48 ++++++++--------
 doc/functions.php               |  44 +++++++--------
 php_stomp.c                     |  94 ++++++++++++++++----------------
 php_stomp.h                     |   4 +-
 stomp.h                         |   4 +-
 tests/002-version.phpt          |   2 +-
 tests/003-connect/001.phpt      |   2 +-
 tests/003-connect/002.phpt      |   4 +-
 tests/003-connect/003.phpt      |   2 +-
 tests/004-getSessionId/001.phpt |   4 +-
 tests/005-close/001.phpt        |   4 +-
 tests/005-close/002.phpt        |   4 +-
 tests/006-send/001.phpt         |   2 +-
 tests/006-send/002.phpt         |   2 +-
 tests/006-send/003.phpt         |   2 +-
 tests/007-subscribe/001.phpt    |   2 +-
 tests/008-unsubscribe/001.phpt  |   2 +-
 tests/009-readFrame/001.phpt    |   2 +-
 tests/009-readFrame/003.phpt    |   4 +-
 tests/009-readFrame/004.phpt    | Bin 433 -> 432 bytes
 tests/009-readFrame/006.phpt    |   2 +-
 tests/010-timeout/001.phpt      |   4 +-
 tests/010-timeout/002.phpt      |   4 +-
 tests/011-commit/001.phpt       |   2 +-
 tests/skipif.inc                |   2 +-
 29 files changed, 139 insertions(+), 139 deletions(-)

diff --git a/LICENSE b/LICENSE
index 6059c80..92ee907 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,7 +1,7 @@
--------------------------------------------------------------------- 
+--------------------------------------------------------------------
                   The PHP License, version 3.01
 Copyright (c) 1999 - 2014 The PHP Group. All rights reserved.
--------------------------------------------------------------------- 
+--------------------------------------------------------------------
 
 Redistribution and use in source and binary forms, with or without
 modification, is permitted provided that the following conditions
@@ -9,22 +9,22 @@ are met:
 
   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
- 
+
   2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in
      the documentation and/or other materials provided with the
      distribution.
- 
+
   3. The name "PHP" must not be used to endorse or promote products
      derived from this software without prior written permission. For
      written permission, please contact group@php.net.
-  
+
   4. Products derived from this software may not be called "PHP", nor
      may "PHP" appear in their name, without prior written permission
      from group@php.net.  You may indicate that your software works in
      conjunction with PHP by saying "Foo for PHP" instead of calling
      it "PHP Foo" or "phpfoo"
- 
+
   5. The PHP Group may publish revised and/or new versions of the
      license from time to time. Each version will be given a
      distinguishing version number.
@@ -41,27 +41,27 @@ are met:
      "This product includes PHP software, freely available from
      <http://www.php.net/software/>".
 
-THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND 
+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
 ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP
-DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 OF THE POSSIBILITY OF SUCH DAMAGE.
 
--------------------------------------------------------------------- 
+--------------------------------------------------------------------
 
 This software consists of voluntary contributions made by many
 individuals on behalf of the PHP Group.
 
 The PHP Group can be contacted via Email at group@php.net.
 
-For more information on the PHP Group and the PHP project, 
+For more information on the PHP Group and the PHP project,
 please see <http://www.php.net>.
 
 PHP includes the Zend Engine, freely available at
diff --git a/README b/README
index 6511d8b..a0c1953 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
 stomp
 =====
 
-This extension allows php applications to communicate with any Stomp compliant Message Broker(s) through easy object 
+This extension allows php applications to communicate with any Stomp compliant Message Broker(s) through easy object
 oriented and procedural interfaces.
 
 This extension currently implements STOMP 1.0 protocol: https://stomp.github.io/stomp-specification-1.0.html
diff --git a/config.m4 b/config.m4
index f700f27..cbeb71b 100644
--- a/config.m4
+++ b/config.m4
@@ -16,7 +16,7 @@ if test "$PHP_STOMP" != "no"; then
             [
             AC_DEFINE(HAVE_STOMP_SSL,1,[ ])
             ], [
-            AC_MSG_ERROR([OpenSSL libraries not found. 
+            AC_MSG_ERROR([OpenSSL libraries not found.
 
                 Check the path given to --with-openssl-dir and output in config.log)
             ])
diff --git a/doc/classes.php b/doc/classes.php
index 0cfc554..06c50a0 100644
--- a/doc/classes.php
+++ b/doc/classes.php
@@ -4,7 +4,7 @@ class Stomp {
 
     /**
      * Connect to server
-     * 
+     *
      * @param string $broker The broker URI
      * @param string $username The username
      * @param string $password The password
@@ -15,7 +15,7 @@ public function __construct($broker = null, $username = null, $password = null,
 
     /**
      * Get the current stomp session ID
-     * 
+     *
      * @return string stomp session ID if it exists, or FALSE otherwise
      */
     public function getSessionId() {
@@ -24,28 +24,28 @@ public function getSessionId() {
     /**
      * Close stomp connection
      *
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
     public function disconnect() {
     }
 
-    /** 
+    /**
      * Sends a message to a destination in the messaging system
-     * 
-     * @param string $destination indicates where to send the message 
+     *
+     * @param string $destination indicates where to send the message
      * @param string|StompFrame $msg message to be sent
      * @param array $headers additional headers (example: receipt).
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
     public function send($destination, $msg, array $headers = array()) {
     }
 
     /**
      * Register to listen to a given destination
-     * 
-     * @param string $destination indicates which destination to subscribe to 
+     *
+     * @param string $destination indicates which destination to subscribe to
      * @param array $headers additional headers (example: receipt).
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
     public function subscribe($destination, array $headers = array()) {
     }
@@ -55,14 +55,14 @@ public function subscribe($destination, array $headers = array()) {
      *
      * @param string $destination indicates which subscription to remove
      * @param array $headers additional headers (example: receipt).
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
     public function unsubscribe($destination, array $headers = array()) {
     }
 
     /**
      * Indicate whether or not there is a frame ready to read
-     * 
+     *
      * @return boolean TRUE if there is one, or FALSE otherwise
      */
     public function hasFrame() {
@@ -81,7 +81,7 @@ public function readFrame($className = 'stompFrame') {
      * Start a transaction
      *
      * @param string $transaction_id transaction id
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
     public function begin($transaction_id) {
     }
@@ -90,26 +90,26 @@ public function begin($transaction_id) {
      * Commit a transaction in progress
      *
      * @param string $transaction_id transaction id
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
-    public function commit($transaction_id) { 
+    public function commit($transaction_id) {
     }
 
     /**
      * Roll back a transaction in progress
      *
      * @param string $transaction_id transaction id
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
     public function abort($transaction_id) {
     }
 
     /**
      * Acknowledge consumption of a message from a subscription using client acknowledgment
-     * 
+     *
      * @param string|StompFrame $msg message/messageId to be acknowledged
      * @param array $headers additional headers (example: receipt).
-     * @return boolean TRUE on success, or FALSE on failure 
+     * @return boolean TRUE on success, or FALSE on failure
      */
     public function ack($msg, array $headers = array()) {
     }
@@ -124,7 +124,7 @@ public function error() {
 
     /**
      * Set timeout
-     * 
+     *
      * @param int $seconds the seconds part of the timeout to be set
      * @param int $microseconds the microseconds part of the timeout to be set
      * @return void
@@ -134,16 +134,16 @@ public function setTimeout($seconds, $microseconds = 0) {
 
     /**
      * Get timeout
-     * 
+     *
      * @return array Array with timeout informations
      */
     public function getTimeout() {
-    }   
+    }
 
 }
 
 class StompFrame {
-    
+
     /**
      * Frame Command
      * @var String
@@ -164,11 +164,11 @@ class StompFrame {
 }
 
 class StompException extends Exception {
-    
+
     /**
      * Get the stomp server error details
      *
-     * @return string 
+     * @return string
      */
     public function getDetails() {
     }
diff --git a/doc/functions.php b/doc/functions.php
index 98486fc..57ae424 100644
--- a/doc/functions.php
+++ b/doc/functions.php
@@ -2,7 +2,7 @@
 
 /**
  * Get the current version of the stomp extension
- * 
+ *
  * @return string version
  */
 function stomp_version() {
@@ -10,19 +10,19 @@ function stomp_version() {
 
 /**
  * Connect to server
- * 
+ *
  * @param string $broker broker URI
  * @param string $username The username
  * @param string $password The password
  * @param array $headers additional headers (example: receipt).
- * @return Ressource stomp connection identifier on success, or FALSE on failure 
+ * @return Ressource stomp connection identifier on success, or FALSE on failure
  */
 function stomp_connect($broker = null, $username = null, $password = null, array $headers = array()) {
 }
 
 /**
  * Get the current stomp session ID
- * 
+ *
  * @param ressource $link identifier returned by stomp_connect
  * @return string stomp session ID if it exists, or FALSE otherwise
  */
@@ -33,30 +33,30 @@ function stomp_get_session_id($link) {
  * Close stomp connection
  *
  * @param ressource $link identifier returned by stomp_connect
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
 function stomp_close($link) {
 }
 
-/** 
+/**
  * Sends a message to a destination in the messaging system
- * 
+ *
  * @param ressource $link identifier returned by stomp_connect
- * @param string $destination indicates where to send the message 
+ * @param string $destination indicates where to send the message
  * @param string|StompFrame $msg message to be sent
  * @param array $headers additional headers (example: receipt).
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
 function stomp_send($link, $destination, $msg, array $headers = array()) {
 }
 
 /**
  * Register to listen to a given destination
- * 
+ *
  * @param ressource $link identifier returned by stomp_connect
- * @param string $destination indicates which destination to subscribe to 
+ * @param string $destination indicates which destination to subscribe to
  * @param array $headers additional headers (example: receipt).
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
 function stomp_subscribe($link, $destination, array $headers = array()) {
 }
@@ -67,14 +67,14 @@ function stomp_subscribe($link, $destination, array $headers = array()) {
  * @param ressource $link identifier returned by stomp_connect
  * @param string $destination indicates which subscription to remove
  * @param array $headers additional headers (example: receipt).
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
 function stomp_unsubscribe($link, $destination, array $headers = array()) {
 }
 
 /**
  * Indicate whether or not there is a frame ready to read
- * 
+ *
  * @param ressource $link identifier returned by stomp_connect
  * @return boolean TRUE if there is one, or FALSE otherwise
  */
@@ -95,7 +95,7 @@ function stomp_read_frame($link) {
  *
  * @param ressource $link identifier returned by stomp_connect
  * @param string $transaction_id transaction id
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
 function stomp_begin($link, $transaction_id) {
 }
@@ -105,9 +105,9 @@ function stomp_begin($link, $transaction_id) {
  *
  * @param ressource $link identifier returned by stomp_connect
  * @param string $transaction_id transaction id
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
-function stomp_commit($link, $transaction_id) { 
+function stomp_commit($link, $transaction_id) {
 }
 
 /**
@@ -115,18 +115,18 @@ function stomp_commit($link, $transaction_id) {
  *
  * @param ressource $link identifier returned by stomp_connect
  * @param string $transaction_id transaction id
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
 function stomp_abort($link, $transaction_id) {
 }
 
 /**
  * Acknowledge consumption of a message from a subscription using client acknowledgment
- * 
+ *
  * @param ressource $link identifier returned by stomp_connect
  * @param string|StompFrame $msg message/messageId to be acknowledged
  * @param array $headers additional headers (example: receipt).
- * @return boolean TRUE on success, or FALSE on failure 
+ * @return boolean TRUE on success, or FALSE on failure
  */
 function stomp_ack($link, $msg, array $headers = array()) {
 }
@@ -142,7 +142,7 @@ function stomp_error($link) {
 
 /**
  * Set timeout
- * 
+ *
  * @param ressource $link identifier returned by stomp_connect
  * @param int $seconds the seconds part of the timeout to be set
  * @param int $microseconds the microseconds part of the timeout to be set
@@ -153,7 +153,7 @@ function stomp_set_timeout($link, $seconds, $microseconds = 0) {
 
 /**
  * Get timeout
- * 
+ *
  * @param ressource $link identifier returned by stomp_connect
  * @return array Array with timeout informations
  */
diff --git a/php_stomp.c b/php_stomp.c
index 080298f..0dcefed 100644
--- a/php_stomp.c
+++ b/php_stomp.c
@@ -83,7 +83,7 @@
 	STOMP_G(error_msg) = estrdup(msg); \
 	if (stomp_object) { \
 		zend_throw_exception_ex(stomp_ce_exception, errno , msg); \
-	} 
+	}
 
 #define STOMP_ERROR_DETAILS(errno, msg, details) \
 	STOMP_G(error_no) = errno; \
@@ -157,7 +157,7 @@ ZEND_ARG_ARRAY_INFO(0, headers, 1)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(stomp_readframe_args, 0, 0, 1)
-ZEND_ARG_INFO(0, link)	
+ZEND_ARG_INFO(0, link)
 ZEND_ARG_INFO(0, class_name)
 ZEND_END_ARG_INFO()
 
@@ -213,7 +213,7 @@ ZEND_BEGIN_ARG_INFO_EX(stomp_frame_construct_args, 0, 0, 0)
 ZEND_ARG_INFO(0, command)
 ZEND_ARG_ARRAY_INFO(0, headers, 1)
 ZEND_ARG_INFO(0, body)
-ZEND_END_ARG_INFO()    
+ZEND_END_ARG_INFO()
 /* }}} */
 
 /* {{{ stomp_functions */
@@ -267,7 +267,7 @@ static zend_function_entry stomp_frame_methods[] = {
 	PHP_ME(stompframe, __construct, stomp_frame_construct_args, ZEND_ACC_PUBLIC)
 	{NULL, NULL, NULL}
 };
-/* }}} */ 
+/* }}} */
 
 /* {{{ stomp_exception_methods[] */
 static zend_function_entry stomp_exception_methods[] = {
@@ -283,7 +283,7 @@ zend_module_entry stomp_module_entry = {
 	stomp_functions,
 	PHP_MINIT(stomp),
 	PHP_MSHUTDOWN(stomp),
-	PHP_RINIT(stomp),    
+	PHP_RINIT(stomp),
 	PHP_RSHUTDOWN(stomp),
 	PHP_MINFO(stomp),
 	PHP_STOMP_VERSION,
@@ -330,9 +330,9 @@ ZEND_GET_MODULE(stomp)
 /* {{{ constructor/destructor */
 static void stomp_send_disconnect(stomp_t *stomp)
 {
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	INIT_FRAME(frame, "DISCONNECT");
-	
+
 	stomp_send(stomp, &frame );
 	CLEAR_FRAME(frame);
 }
@@ -342,7 +342,7 @@ static void php_destroy_stomp_res(zend_resource *rsrc)
 	stomp_t *stomp = (stomp_t *) rsrc->ptr;
 	stomp_send_disconnect(stomp );
 	stomp_close(stomp);
-} 
+}
 
 static zend_object *php_stomp_new(zend_class_entry *ce)
 {
@@ -350,7 +350,7 @@ static zend_object *php_stomp_new(zend_class_entry *ce)
 
 	intern = (stomp_object_t *) ecalloc(1, sizeof(stomp_object_t) + zend_object_properties_size(ce));
 	intern->stomp = NULL;
-	
+
 	zend_object_std_init(&intern->std, ce );
 
 	intern->std.handlers = &stomp_obj_handlers;
@@ -381,7 +381,7 @@ PHP_MINIT_FUNCTION(stomp)
 	/* Properties */
 	zend_declare_property_null(stomp_ce_frame, "command", sizeof("command")-1, ZEND_ACC_PUBLIC );
 	zend_declare_property_null(stomp_ce_frame, "headers", sizeof("headers")-1, ZEND_ACC_PUBLIC );
-	zend_declare_property_null(stomp_ce_frame, "body", sizeof("body")-1, ZEND_ACC_PUBLIC ); 
+	zend_declare_property_null(stomp_ce_frame, "body", sizeof("body")-1, ZEND_ACC_PUBLIC );
 
 	/* Register StompException class */
 	INIT_CLASS_ENTRY(ce, PHP_STOMP_EXCEPTION_CLASSNAME, stomp_exception_methods);
@@ -399,7 +399,7 @@ PHP_MINIT_FUNCTION(stomp)
 
 /* {{{ PHP_MSHUTDOWN_FUNCTION */
 PHP_MSHUTDOWN_FUNCTION(stomp)
-{ 
+{
 	/* Unregister INI entries */
 	UNREGISTER_INI_ENTRIES();
 	return SUCCESS;
@@ -443,9 +443,9 @@ PHP_MINFO_FUNCTION(stomp)
 }
 /* }}} */
 
-/* {{{ proto string stomp_version() 
+/* {{{ proto string stomp_version()
    Get stomp extension version */
-PHP_FUNCTION(stomp_version) 
+PHP_FUNCTION(stomp_version)
 {
 	RETURN_STRINGL(PHP_STOMP_VERSION, sizeof(PHP_STOMP_VERSION)-1);
 }
@@ -461,9 +461,9 @@ PHP_FUNCTION(stomp_connect)
 	zend_string *broker = NULL, *username = NULL, *password = NULL;
 	php_url *url_parts;
 
-#ifdef HAVE_STOMP_SSL    
+#ifdef HAVE_STOMP_SSL
 	int use_ssl = 0;
-#endif    
+#endif
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() , "|SSSa!", &broker, &username, &password, &headers) == FAILURE) {
 		return;
@@ -478,7 +478,7 @@ PHP_FUNCTION(stomp_connect)
 	}
 
 	url_parts = php_url_parse_ex(ZSTR_VAL(broker), ZSTR_LEN(broker));
-	
+
 	if (!url_parts || !url_parts->host) {
 		STOMP_ERROR(0, PHP_STOMP_ERR_INVALID_BROKER_URI);
 		zend_string_release(broker);
@@ -495,7 +495,7 @@ PHP_FUNCTION(stomp_connect)
 			STOMP_ERROR(0, "SSL DISABLED");
 			php_url_free(url_parts);
 			return;
-#endif        
+#endif
 		} else if (strcmp(STOMP_URL_STR(url_parts->scheme), "tcp") != 0) {
 			STOMP_ERROR(0, PHP_STOMP_ERR_INVALID_BROKER_URI_SCHEME);
 			php_url_free(url_parts);
@@ -507,7 +507,7 @@ PHP_FUNCTION(stomp_connect)
 
 #if HAVE_STOMP_SSL
 	stomp->options.use_ssl = use_ssl;
-#endif 
+#endif
 
 	stomp->options.read_timeout_sec     = STOMP_G(read_timeout_sec);
 	stomp->options.read_timeout_usec    = STOMP_G(read_timeout_usec);
@@ -522,7 +522,7 @@ PHP_FUNCTION(stomp_connect)
 		stomp_frame_t *res;
 		stomp_frame_t frame = {0};
 		int send_status;
- 
+
 		INIT_FRAME(frame, "CONNECT");
 		if (!username) {
 			username = zend_string_init(STOMP_G(default_username), strlen(STOMP_G(default_username)), 0);
@@ -548,7 +548,7 @@ PHP_FUNCTION(stomp_connect)
 			ZVAL_STR(&rv, zend_string_copy(password));
 			zend_hash_str_add(frame.headers, "passcode", sizeof("passcode"), &rv);
 		}
- 
+
 		zend_string_release(username);
 		zend_string_release(password);
 
@@ -607,7 +607,7 @@ PHP_FUNCTION(stomp_connect)
 				i_obj->stomp = stomp;
 				RETURN_TRUE;
 			}
-		} 
+		}
 	} else {
 		STOMP_ERROR_DETAILS(0, stomp->error, stomp->error_details);
 	}
@@ -617,9 +617,9 @@ PHP_FUNCTION(stomp_connect)
 }
 /* }}} */
 
-/* {{{ proto string stomp_connect_error() 
+/* {{{ proto string stomp_connect_error()
    Get the last connection error */
-PHP_FUNCTION(stomp_connect_error) 
+PHP_FUNCTION(stomp_connect_error)
 {
 	if (STOMP_G(error_msg)) {
 		RETURN_STRING(STOMP_G(error_msg));
@@ -629,7 +629,7 @@ PHP_FUNCTION(stomp_connect_error)
 }
 /* }}} */
 
-/* {{{ proto string Stomp::getSessionId() 
+/* {{{ proto string Stomp::getSessionId()
    Get the current stomp session ID */
 PHP_FUNCTION(stomp_get_session_id)
 {
@@ -695,13 +695,13 @@ PHP_FUNCTION(stomp_send)
 	stomp_t *stomp = NULL;
 	zend_string *destination;
 	zval *msg, *headers = NULL, rv;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 
 	if (stomp_object) {
 		if (zend_parse_parameters(ZEND_NUM_ARGS() , "Sz|a!", &destination, &msg, &headers) == FAILURE) {
 			return;
-		} 
+		}
 		FETCH_STOMP_OBJECT;
 	} else {
 		zval *arg;
@@ -718,7 +718,7 @@ PHP_FUNCTION(stomp_send)
 	}
 
 	INIT_FRAME(frame, "SEND");
-	
+
 	/* Translate a PHP array to a stomp_header array */
 	if (NULL != headers) {
 		FRAME_HEADER_FROM_HASHTABLE(frame.headers, Z_ARRVAL_P(headers));
@@ -727,7 +727,7 @@ PHP_FUNCTION(stomp_send)
 	/* Add the destination */
 	ZVAL_STR(&rv, zend_string_copy(destination));
 	zend_hash_str_add(frame.headers, "destination", sizeof("destination") - 1, &rv);
-	 
+
 	if (Z_TYPE_P(msg) == IS_STRING) {
 		frame.body = Z_STRVAL_P(msg);
 		frame.body_length = Z_STRLEN_P(msg);
@@ -770,7 +770,7 @@ PHP_FUNCTION(stomp_subscribe)
 	stomp_t *stomp = NULL;
 	zend_string *destination;
 	zval *headers = NULL, rv;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 
 	if (stomp_object) {
@@ -793,7 +793,7 @@ PHP_FUNCTION(stomp_subscribe)
 	}
 
 	INIT_FRAME(frame, "SUBSCRIBE");
-	 
+
 	/* Translate a PHP array to a stomp_header array */
 	if (NULL != headers) {
 		FRAME_HEADER_FROM_HASHTABLE(frame.headers, Z_ARRVAL_P(headers));
@@ -824,7 +824,7 @@ PHP_FUNCTION(stomp_unsubscribe)
 	stomp_t *stomp = NULL;
 	zend_string *destination;
 	zval *headers = NULL, rv;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 
 	if (stomp_object) {
@@ -847,7 +847,7 @@ PHP_FUNCTION(stomp_unsubscribe)
 	}
 
 	INIT_FRAME(frame, "UNSUBSCRIBE");
-	 
+
 	/* Translate a PHP array to a stomp_header array */
 	if (NULL != headers) {
 		FRAME_HEADER_FROM_HASHTABLE(frame.headers, Z_ARRVAL_P(headers));
@@ -866,9 +866,9 @@ PHP_FUNCTION(stomp_unsubscribe)
 }
 /* }}} */
 
-/* {{{ proto boolean Stomp::hasFrame() 
+/* {{{ proto boolean Stomp::hasFrame()
    Indicate whether or not there is a frame ready to read */
-PHP_FUNCTION(stomp_has_frame) 
+PHP_FUNCTION(stomp_has_frame)
 {
 	zval *stomp_object = getThis();
 	stomp_t *stomp = NULL;
@@ -886,7 +886,7 @@ PHP_FUNCTION(stomp_has_frame)
 }
 /* }}} */
 
-/* {{{ proto StompFrame Stomp::readFrame() 
+/* {{{ proto StompFrame Stomp::readFrame()
    Read the next frame */
 PHP_FUNCTION(stomp_read_frame)
 {
@@ -947,7 +947,7 @@ PHP_FUNCTION(stomp_read_frame)
 				zend_hash_update(Z_ARRVAL(headers), key, val);
 			} ZEND_HASH_FOREACH_END();
 		}
-		
+
 		if (ce) {
 			zend_fcall_info fci;
 			zend_fcall_info_cache fcc;
@@ -1029,14 +1029,14 @@ static void _php_stomp_transaction(INTERNAL_FUNCTION_PARAMETERS, char *cmd, size
 	zval *stomp_object = getThis();
 	stomp_t *stomp = NULL;
 	zend_string *transaction_id;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 	zval *headers = NULL, rv;
 
 	if (stomp_object) {
 		if (zend_parse_parameters(ZEND_NUM_ARGS() , "S|a", &transaction_id, &headers) == FAILURE) {
 			return;
-		} 
+		}
 		FETCH_STOMP_OBJECT;
 	} else {
 		zval *arg;
@@ -1091,19 +1091,19 @@ PHP_FUNCTION(stomp_abort)
 }
 /* }}} */
 
-/* {{{ _php_stomp_acknowledgment 
+/* {{{ _php_stomp_acknowledgment
  */
 static void _php_stomp_acknowledgment(INTERNAL_FUNCTION_PARAMETERS, char *cmd) {
 	zval *stomp_object = getThis();
 	zval *msg, *headers = NULL;
 	stomp_t *stomp = NULL;
-	stomp_frame_t frame = {0}; 
+	stomp_frame_t frame = {0};
 	int success = 0;
 
 	if (stomp_object) {
 		if (zend_parse_parameters(ZEND_NUM_ARGS() , "z|a!", &msg, &headers) == FAILURE) {
 			return;
-		} 
+		}
 		FETCH_STOMP_OBJECT;
 	} else {
 		zval *arg;
@@ -1135,7 +1135,7 @@ static void _php_stomp_acknowledgment(INTERNAL_FUNCTION_PARAMETERS, char *cmd) {
 		CLEAR_FRAME(frame);
 		RETURN_FALSE;
 	}
-	
+
 	if (stomp_send(stomp, &frame ) > 0) {
 		success = stomp_valid_receipt(stomp, &frame);
 	}
@@ -1161,7 +1161,7 @@ PHP_FUNCTION(stomp_nack)
 }
 /* }}} */
 
-/* {{{ proto string Stomp::error() 
+/* {{{ proto string Stomp::error()
    Get the last error message */
 PHP_FUNCTION(stomp_error)
 {
@@ -1205,7 +1205,7 @@ PHP_FUNCTION(stomp_set_read_timeout)
 		if (zend_parse_parameters(ZEND_NUM_ARGS() , "l|l", &sec, &usec) == FAILURE) {
 			return;
 		}
-		FETCH_STOMP_OBJECT; 
+		FETCH_STOMP_OBJECT;
 	} else {
 		zval *arg;
 		if (zend_parse_parameters(ZEND_NUM_ARGS() , "rl|l", &arg, &sec, &usec) == FAILURE) {
@@ -1219,14 +1219,14 @@ PHP_FUNCTION(stomp_set_read_timeout)
 }
 /* }}} */
 
-/* {{{ proto array Stomp::getTimeout() 
+/* {{{ proto array Stomp::getTimeout()
    Get the timeout */
 PHP_FUNCTION(stomp_get_read_timeout)
 {
 	zval *stomp_object = getThis();
 	stomp_t *stomp = NULL;
 	if (stomp_object) {
-		FETCH_STOMP_OBJECT; 
+		FETCH_STOMP_OBJECT;
 	} else {
 		zval *arg;
 		if (zend_parse_parameters(ZEND_NUM_ARGS() , "r", &arg) == FAILURE) {
@@ -1270,7 +1270,7 @@ PHP_METHOD(stompframe, __construct)
    Get error details */
 PHP_METHOD(stompexception, getDetails)
 {
-	zval *object = getThis();	
+	zval *object = getThis();
 	zval rv, *details = zend_read_property(stomp_ce_exception, object, "details", sizeof("details")-1, 1, &rv);
 	RETURN_STR(zval_get_string(details));
 }
diff --git a/php_stomp.h b/php_stomp.h
index 805b9f6..fdaaa3e 100644
--- a/php_stomp.h
+++ b/php_stomp.h
@@ -24,7 +24,7 @@
 typedef struct _stomp_object {
 	stomp_t *stomp;
 	zend_object std;
-} stomp_object_t; 
+} stomp_object_t;
 
 #define PHP_STOMP_EXTNAME                       "Stomp"
 #define PHP_STOMP_VERSION                       "2.0.2"
@@ -104,7 +104,7 @@ ZEND_END_MODULE_GLOBALS(stomp)
 #define STOMP_G(v) TSRMG(stomp_globals_id, zend_stomp_globals *, v)
 #else
 #define STOMP_G(v) (stomp_globals.v)
-#endif 
+#endif
 
 #endif /* PHP_STOMP_H */
 
diff --git a/stomp.h b/stomp.h
index 19bd8dd..1a422b7 100644
--- a/stomp.h
+++ b/stomp.h
@@ -40,7 +40,7 @@ typedef struct _stomp_options {
 	long read_timeout_usec;
 #if HAVE_STOMP_SSL
 	int use_ssl;
-#endif    
+#endif
 } stomp_options_t;
 
 typedef struct _stomp_frame {
@@ -57,7 +57,7 @@ typedef struct _stomp_frame_stack {
 } stomp_frame_stack_t;
 
 typedef struct _stomp {
-	php_socket_t fd;    
+	php_socket_t fd;
 	php_sockaddr_storage localaddr;
 	stomp_options_t options;
 	char *host;
diff --git a/tests/002-version.phpt b/tests/002-version.phpt
index d3779aa..6e30db1 100644
--- a/tests/002-version.phpt
+++ b/tests/002-version.phpt
@@ -3,7 +3,7 @@ Test stomp_version()
 --SKIPIF--
 <?php if (!extension_loaded("stomp")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 echo stomp_version();
 ?>
 --EXPECTF--
diff --git a/tests/003-connect/001.phpt b/tests/003-connect/001.phpt
index 31b48c1..1e3c968 100644
--- a/tests/003-connect/001.phpt
+++ b/tests/003-connect/001.phpt
@@ -3,7 +3,7 @@ Test stomp_connect() - URI validation
 --SKIPIF--
 <?php if (!extension_loaded("stomp")) print "skip"; ?>
 --FILE--
-<?php 
+<?php
 var_dump(stomp_connect(''), stomp_connect_error());
 var_dump(stomp_connect(1), stomp_connect_error());
 var_dump(stomp_connect('foo'), stomp_connect_error());
diff --git a/tests/003-connect/002.phpt b/tests/003-connect/002.phpt
index 6c40f37..4d05989 100644
--- a/tests/003-connect/002.phpt
+++ b/tests/003-connect/002.phpt
@@ -1,12 +1,12 @@
 --TEST--
-Test stomp_connect() - Test connection 
+Test stomp_connect() - Test connection
 --SKIPIF--
 <?php
 $require_connection = true;
 include dirname(__DIR__). "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/config.inc";
 var_dump(stomp_connect(STOMP_ADDRESS));
 var_dump(stomp_connect_error());
diff --git a/tests/003-connect/003.phpt b/tests/003-connect/003.phpt
index eb25a40..b3de8d6 100644
--- a/tests/003-connect/003.phpt
+++ b/tests/003-connect/003.phpt
@@ -5,7 +5,7 @@ Test stomp_connect() - Test error on CONNECT
 include "../skipif.inc"
 ?>
 --FILE--
-<?php 
+<?php
 try {
 	$stomp = new Stomp('tcp://localhost', 'anotpresentusername1234');
 } catch (Exception $e) {
diff --git a/tests/004-getSessionId/001.phpt b/tests/004-getSessionId/001.phpt
index a798a1a..08b92a9 100644
--- a/tests/004-getSessionId/001.phpt
+++ b/tests/004-getSessionId/001.phpt
@@ -1,12 +1,12 @@
 --TEST--
 Test stomp_get_session_id()
 --SKIPIF--
-<?php 
+<?php
 $require_connection = true;
 include dirname(__DIR__) . '/skipif.inc';
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/config.inc";
 $link = stomp_connect(STOMP_ADDRESS);
 var_dump(stomp_get_session_id($link));
diff --git a/tests/005-close/001.phpt b/tests/005-close/001.phpt
index 9e46e78..0a23a59 100644
--- a/tests/005-close/001.phpt
+++ b/tests/005-close/001.phpt
@@ -1,11 +1,11 @@
 --TEST--
 Test stomp_close() - tests parameters
 --SKIPIF--
-<?php 
+<?php
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 stomp_close(null);
 ?>
 --EXPECTF--
diff --git a/tests/005-close/002.phpt b/tests/005-close/002.phpt
index b24c197..b3dbd95 100644
--- a/tests/005-close/002.phpt
+++ b/tests/005-close/002.phpt
@@ -1,12 +1,12 @@
 --TEST--
 Test stomp_close()
 --SKIPIF--
-<?php 
+<?php
 $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/config.inc";
 $link = stomp_connect(STOMP_ADDRESS);
 if($link) echo "success" . PHP_EOL;
diff --git a/tests/006-send/001.phpt b/tests/006-send/001.phpt
index 65cc607..82b29c6 100644
--- a/tests/006-send/001.phpt
+++ b/tests/006-send/001.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/skipif.inc";
 
 $link = stomp_connect(STOMP_ADDRESS);
diff --git a/tests/006-send/002.phpt b/tests/006-send/002.phpt
index 35da23e..6301c39 100644
--- a/tests/006-send/002.phpt
+++ b/tests/006-send/002.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 
 include dirname(__DIR__) . "/config.inc";
 
diff --git a/tests/006-send/003.phpt b/tests/006-send/003.phpt
index 5a4d384..14f2745 100644
--- a/tests/006-send/003.phpt
+++ b/tests/006-send/003.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/skipif.inc";
 $s = new Stomp(STOMP_ADDRESS);
 var_dump($s->send('/queue/test-06', 'A real message', array('receipt' => 'message-12345')));
diff --git a/tests/007-subscribe/001.phpt b/tests/007-subscribe/001.phpt
index 644c404..8d190dd 100644
--- a/tests/007-subscribe/001.phpt
+++ b/tests/007-subscribe/001.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/skipif.inc";
 
 $s = new Stomp(STOMP_ADDRESS);
diff --git a/tests/008-unsubscribe/001.phpt b/tests/008-unsubscribe/001.phpt
index 647d7a5..c1200eb 100644
--- a/tests/008-unsubscribe/001.phpt
+++ b/tests/008-unsubscribe/001.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/config.inc";
 
 $s = new Stomp(STOMP_ADDRESS);
diff --git a/tests/009-readFrame/001.phpt b/tests/009-readFrame/001.phpt
index fe600b3..e67bad6 100644
--- a/tests/009-readFrame/001.phpt
+++ b/tests/009-readFrame/001.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 include dirname(__DIR__) . "/config.inc";
 
 $s = new Stomp(STOMP_ADDRESS);
diff --git a/tests/009-readFrame/003.phpt b/tests/009-readFrame/003.phpt
index f1e29b6..6e61254 100644
--- a/tests/009-readFrame/003.phpt
+++ b/tests/009-readFrame/003.phpt
@@ -1,12 +1,12 @@
 --TEST--
-Test stomp::readFrame() - custom frame class 
+Test stomp::readFrame() - custom frame class
 --SKIPIF--
 <?php
 $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 
 include dirname(__DIR__) . "/config.inc";
 
diff --git a/tests/009-readFrame/006.phpt b/tests/009-readFrame/006.phpt
index 0d1ffc4..e90ee80 100644
--- a/tests/009-readFrame/006.phpt
+++ b/tests/009-readFrame/006.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 
 include dirname(__DIR__) . "/config.inc";
 
diff --git a/tests/010-timeout/001.phpt b/tests/010-timeout/001.phpt
index 8256baa..7389f70 100644
--- a/tests/010-timeout/001.phpt
+++ b/tests/010-timeout/001.phpt
@@ -5,11 +5,11 @@ stomp.default_read_timeout_sec=5
 stomp.default_read_timeout_usec=5
 --SKIPIF--
 <?php
-    if (!extension_loaded("stomp")) print "skip"; 
+    if (!extension_loaded("stomp")) print "skip";
     if (!stomp_connect()) print "skip";
 ?>
 --FILE--
-<?php 
+<?php
 $s = new Stomp();
 
 // First test, read from ini variables,  expected to return 5.5
diff --git a/tests/010-timeout/002.phpt b/tests/010-timeout/002.phpt
index 65d3c28..a150cb8 100644
--- a/tests/010-timeout/002.phpt
+++ b/tests/010-timeout/002.phpt
@@ -5,11 +5,11 @@ stomp.default_read_timeout_sec=5
 stomp.default_read_timeout_usec=5
 --SKIPIF--
 <?php
-    if (!extension_loaded("stomp")) print "skip"; 
+    if (!extension_loaded("stomp")) print "skip";
     if (!stomp_connect()) print "skip";
 ?>
 --FILE--
-<?php 
+<?php
 $link = stomp_connect();
 
 // First test, read from ini variables, expected to return 5.5
diff --git a/tests/011-commit/001.phpt b/tests/011-commit/001.phpt
index 3636095..33dd57d 100644
--- a/tests/011-commit/001.phpt
+++ b/tests/011-commit/001.phpt
@@ -6,7 +6,7 @@ $require_connection = true;
 include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
-<?php 
+<?php
 
 include dirname(__DIR__) . "/config.inc";
 
diff --git a/tests/skipif.inc b/tests/skipif.inc
index 033a4be..858dd49 100644
--- a/tests/skipif.inc
+++ b/tests/skipif.inc
@@ -2,7 +2,7 @@
 include __DIR__ . "/config.inc";
 
 if (!extension_loaded("stomp")) {
-	print "skip"; 
+	print "skip";
 }
 if (isset($require_connection) && $require_connection) {
     $stomp = stomp_connect(STOMP_ADDRESS);

From 13681a79d9389603d9788802f0a114671a753df1 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 25 Sep 2020 16:06:39 +0200
Subject: [PATCH 1/2] Fix compatibility with PHP 8 - cleanup remaining TSRMLS
 macros - fix read/update_property parameters - adapt test suite for exception
 in arg. parsing - fix callback

---
 php_stomp.c                    | 38 ++++++++++++++++++++--------------
 stomp.c                        |  6 +++---
 stomp.h                        |  4 ++--
 tests/003-connect/003.phpt     |  2 +-
 tests/005-close/001.phpt       |  8 +++++--
 tests/007-subscribe/001.phpt   |  2 +-
 tests/008-unsubscribe/001.phpt |  2 +-
 tests/010-timeout/001.phpt     | 24 ++++++++++++---------
 tests/010-timeout/002.phpt     | 26 ++++++++++++++---------
 9 files changed, 67 insertions(+), 45 deletions(-)

diff --git a/php_stomp.c b/php_stomp.c
index 0dcefed..b99a9ff 100644
--- a/php_stomp.c
+++ b/php_stomp.c
@@ -95,7 +95,7 @@
 		zval _object, *object = &_object; \
 		THROW_STOMP_EXCEPTION(object, errno, msg) \
         if (details) { \
-            zend_update_property_string(stomp_ce_exception, object, "details", sizeof("details")-1, (char *) details ); \
+            zend_update_property_string(stomp_ce_exception, OBJ_FOR_PROP(object), "details", sizeof("details")-1, (char *) details ); \
         } \
     }
 
@@ -105,6 +105,12 @@
 #define STOMP_URL_STR(a) ZSTR_VAL(a)
 #endif
 
+#if PHP_VERSION_ID < 80000
+#define OBJ_FOR_PROP(zv) (zv)
+#else
+#define OBJ_FOR_PROP(zv) Z_OBJ_P(zv)
+#endif
+
 static int le_stomp;
 static zend_object_handlers stomp_obj_handlers;
 
@@ -562,7 +568,7 @@ PHP_FUNCTION(stomp_connect)
 			zval excobj;
 			THROW_STOMP_EXCEPTION(&excobj, stomp->errnum, stomp->error);
 			if (stomp->error_details) {
-				zend_update_property_string(stomp_ce_exception, &excobj, "details", sizeof("details")-1, stomp->error_details );
+				zend_update_property_string(stomp_ce_exception, OBJ_FOR_PROP(&excobj), "details", sizeof("details")-1, stomp->error_details );
 			}
 			return;
 		}
@@ -576,7 +582,7 @@ PHP_FUNCTION(stomp_connect)
 			if ((error_msg = zend_hash_str_find(res->headers, ZEND_STRL("message"))) != NULL) {
 				THROW_STOMP_EXCEPTION(&excobj, 0, ZSTR_VAL(Z_STR_P(error_msg)));
 				if (res->body) {
-					zend_update_property_string(stomp_ce_exception, &excobj, "details", sizeof("details")-1, (char *) res->body );
+					zend_update_property_string(stomp_ce_exception, OBJ_FOR_PROP(&excobj), "details", sizeof("details")-1, (char *) res->body );
 				}
 			}
 			stomp_free_frame(res);
@@ -733,17 +739,17 @@ PHP_FUNCTION(stomp_send)
 		frame.body_length = Z_STRLEN_P(msg);
 	} else if (Z_TYPE_P(msg) == IS_OBJECT && instanceof_function(Z_OBJCE_P(msg), stomp_ce_frame )) {
 		zval *frame_obj_prop = NULL;
-		frame_obj_prop = zend_read_property(stomp_ce_frame, msg, "command", sizeof("command")-1, 1, &rv);
+		frame_obj_prop = zend_read_property(stomp_ce_frame, OBJ_FOR_PROP(msg), "command", sizeof("command")-1, 1, &rv);
 		if (Z_TYPE_P(frame_obj_prop) == IS_STRING) {
 			frame.command = Z_STRVAL_P(frame_obj_prop);
 			frame.command_length = Z_STRLEN_P(frame_obj_prop);
 		}
-		frame_obj_prop = zend_read_property(stomp_ce_frame, msg, "body", sizeof("body")-1, 1, &rv);
+		frame_obj_prop = zend_read_property(stomp_ce_frame, OBJ_FOR_PROP(msg), "body", sizeof("body")-1, 1, &rv);
 		if (Z_TYPE_P(frame_obj_prop) == IS_STRING) {
 			frame.body = Z_STRVAL_P(frame_obj_prop);
 			frame.body_length = Z_STRLEN_P(frame_obj_prop);
 		}
-		frame_obj_prop = zend_read_property(stomp_ce_frame, msg, "headers", sizeof("headers")-1, 1, &rv);
+		frame_obj_prop = zend_read_property(stomp_ce_frame, OBJ_FOR_PROP(msg), "headers", sizeof("headers")-1, 1, &rv);
 		if (Z_TYPE_P(frame_obj_prop) == IS_ARRAY) {
 			FRAME_HEADER_FROM_HASHTABLE(frame.headers, Z_ARRVAL_P(frame_obj_prop));
 		}
@@ -928,7 +934,7 @@ PHP_FUNCTION(stomp_read_frame)
 				zval excobj;
 				THROW_STOMP_EXCEPTION(&excobj, 0, Z_STRVAL_P(error_msg));
 				if (res->body) {
-					zend_update_property_string(stomp_ce_exception, &excobj, ZEND_STRL("details"), (char *)res->body );
+					zend_update_property_string(stomp_ce_exception, OBJ_FOR_PROP(&excobj), ZEND_STRL("details"), (char *)res->body );
 				}
 				stomp_free_frame(res);
 				RETURN_FALSE;
@@ -966,10 +972,11 @@ PHP_FUNCTION(stomp_read_frame)
 					ZVAL_NULL(&body);
 				}
 
+				memset(&fci, 0, sizeof(fci));
+				memset(&fcc, 0, sizeof(fcc));
 				fci.size = sizeof(fci);
 #if (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION == 0)
 				fci.function_table = &ce->function_table;
-				fci.symbol_table = NULL;
 #endif
 				/* PARAMS */
 				fci.param_count = 3;
@@ -981,8 +988,9 @@ PHP_FUNCTION(stomp_read_frame)
 				ZVAL_UNDEF(&fci.function_name);
 				fci.object = Z_OBJ_P(return_value);
 				fci.retval = &retval;
+#if PHP_VERSION_ID < 80000
 				fci.no_separation = 1;
-
+#endif
 #if PHP_VERSION_ID < 70300
 				fcc.initialized = 1;
 #endif
@@ -995,7 +1003,7 @@ PHP_FUNCTION(stomp_read_frame)
 				fcc.object = Z_OBJ_P(return_value);
 
 				if (zend_call_function(&fci, &fcc ) == FAILURE) {
-					zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 , "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
+					zend_throw_exception_ex(zend_exception_get_default(), 0 , "Could not execute %s::%s()", ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
 				} else {
 					zval_ptr_dtor(&retval);
 				}
@@ -1125,7 +1133,7 @@ static void _php_stomp_acknowledgment(INTERNAL_FUNCTION_PARAMETERS, char *cmd) {
 	} else if (Z_TYPE_P(msg) == IS_OBJECT && instanceof_function(Z_OBJCE_P(msg), stomp_ce_frame )) {
 		zval *frame_obj_prop, rv;
 
-		frame_obj_prop = zend_read_property(stomp_ce_frame, msg, "headers", sizeof("headers")-1, 1, &rv);
+		frame_obj_prop = zend_read_property(stomp_ce_frame, OBJ_FOR_PROP(msg), "headers", sizeof("headers")-1, 1, &rv);
 		if (Z_TYPE_P(frame_obj_prop) == IS_ARRAY) {
 			FRAME_HEADER_FROM_HASHTABLE(frame.headers, Z_ARRVAL_P(frame_obj_prop));
 		}
@@ -1255,13 +1263,13 @@ PHP_METHOD(stompframe, __construct)
 	}
 
 	if (command_length > 0) {
-		zend_update_property_stringl(stomp_ce_frame, object, "command", sizeof("command")-1, command, command_length );
+		zend_update_property_stringl(stomp_ce_frame, OBJ_FOR_PROP(object), "command", sizeof("command")-1, command, command_length );
 	}
 	if (headers) {
-		zend_update_property(stomp_ce_frame, object, "headers", sizeof("headers")-1, headers );
+		zend_update_property(stomp_ce_frame, OBJ_FOR_PROP(object), "headers", sizeof("headers")-1, headers );
 	}
 	if (body_length > 0) {
-		zend_update_property_stringl(stomp_ce_frame, object, "body", sizeof("body")-1, body, body_length );
+		zend_update_property_stringl(stomp_ce_frame, OBJ_FOR_PROP(object), "body", sizeof("body")-1, body, body_length );
 	}
 }
 /* }}} */
@@ -1271,7 +1279,7 @@ PHP_METHOD(stompframe, __construct)
 PHP_METHOD(stompexception, getDetails)
 {
 	zval *object = getThis();
-	zval rv, *details = zend_read_property(stomp_ce_exception, object, "details", sizeof("details")-1, 1, &rv);
+	zval rv, *details = zend_read_property(stomp_ce_exception, OBJ_FOR_PROP(object), "details", sizeof("details")-1, 1, &rv);
 	RETURN_STR(zval_get_string(details));
 }
 /* }}} */
diff --git a/stomp.c b/stomp.c
index d83a4e6..6e77ede 100644
--- a/stomp.c
+++ b/stomp.c
@@ -34,7 +34,7 @@ extern zend_class_entry *stomp_ce_exception;
 
 /* {{{ DEBUG */
 #if PHP_DEBUG
-static void print_stomp_frame(stomp_frame_t *frame TSRMLS_DC) {
+static void print_stomp_frame(stomp_frame_t *frame) {
 	php_printf("------ START FRAME ------\n");
 	php_printf("%s\n", frame->command);
 	/* Headers */
@@ -186,7 +186,7 @@ int stomp_writable(stomp_t *stomp)
 
 /* {{{ stomp_connect
  */
-int stomp_connect(stomp_t *stomp, const char *host, unsigned short port TSRMLS_DC)
+int stomp_connect(stomp_t *stomp, const char *host, unsigned short port)
 {
 	char error[1024];
 	socklen_t size;
@@ -297,7 +297,7 @@ void stomp_close(stomp_t *stomp)
 
 /* {{{ stomp_send
  */
-int stomp_send(stomp_t *stomp, stomp_frame_t *frame TSRMLS_DC)
+int stomp_send(stomp_t *stomp, stomp_frame_t *frame)
 {
 	smart_str buf = {0};
 
diff --git a/stomp.h b/stomp.h
index 1a422b7..e4d02b3 100644
--- a/stomp.h
+++ b/stomp.h
@@ -79,9 +79,9 @@ typedef struct _stomp {
 } stomp_t;
 
 stomp_t *stomp_init();
-int stomp_connect(stomp_t *stomp, const char *host, unsigned short port TSRMLS_DC);
+int stomp_connect(stomp_t *stomp, const char *host, unsigned short port);
 void stomp_close(stomp_t *stomp);
-int stomp_send(stomp_t *connection, stomp_frame_t *frame TSRMLS_DC);
+int stomp_send(stomp_t *connection, stomp_frame_t *frame);
 stomp_frame_t *stomp_read_frame_ex(stomp_t *connection, int use_stack);
 int stomp_valid_receipt(stomp_t *connection, stomp_frame_t *frame);
 int stomp_select_ex(stomp_t *connection, const long int sec, const long int usec);
diff --git a/tests/003-connect/003.phpt b/tests/003-connect/003.phpt
index b3de8d6..ba60e15 100644
--- a/tests/003-connect/003.phpt
+++ b/tests/003-connect/003.phpt
@@ -2,7 +2,7 @@
 Test stomp_connect() - Test error on CONNECT
 --SKIPIF--
 <?php
-include "../skipif.inc"
+include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
 <?php
diff --git a/tests/005-close/001.phpt b/tests/005-close/001.phpt
index 0a23a59..77cc014 100644
--- a/tests/005-close/001.phpt
+++ b/tests/005-close/001.phpt
@@ -6,7 +6,11 @@ include dirname(__DIR__) . "/skipif.inc";
 ?>
 --FILE--
 <?php
-stomp_close(null);
+try {
+	stomp_close(null);
+} catch (TypeError $e) {
+	echo $e->getMessage() . PHP_EOL;
+}
 ?>
 --EXPECTF--
-Warning: stomp_close() expects parameter 1 to be resource, null given in %s on line %d
+%stomp_close()%s1%s null %s
diff --git a/tests/007-subscribe/001.phpt b/tests/007-subscribe/001.phpt
index 8d190dd..494471c 100644
--- a/tests/007-subscribe/001.phpt
+++ b/tests/007-subscribe/001.phpt
@@ -16,7 +16,7 @@ $s->subscribe('/queue/test', 'string');
 --EXPECTF--
 Warning: Stomp::subscribe(): Destination can not be empty in %s007-subscribe%c001.php on line %d
 
-Fatal error: Uncaught TypeError: Argument 2 passed to Stomp::subscribe() must be of the type array, string given in %s007-subscribe%c001.php:%d
+Fatal error: Uncaught TypeError: %s, string given in %s007-subscribe%c001.php:%d
 Stack trace:
 #0 %s001.php(%d): Stomp->subscribe('/queue/test', 'string')
 #1 {main}
diff --git a/tests/008-unsubscribe/001.phpt b/tests/008-unsubscribe/001.phpt
index c1200eb..7d1b50f 100644
--- a/tests/008-unsubscribe/001.phpt
+++ b/tests/008-unsubscribe/001.phpt
@@ -17,7 +17,7 @@ $s->unsubscribe('/queue/test', 'string');
 --EXPECTF--
 Warning: Stomp::unsubscribe(): Destination can not be empty in %s008-unsubscribe%c001.php on line %d
 
-Fatal error: Uncaught TypeError: Argument 2 passed to Stomp::unsubscribe() must be of the type array, string given in %s008-unsubscribe%c001.php:%d
+Fatal error: Uncaught TypeError: %s2%s string given in %s008-unsubscribe%c001.php:%d
 Stack trace:
 #0 %s(%d): Stomp->unsubscribe('/queue/test', 'string')
 #1 {main}
diff --git a/tests/010-timeout/001.phpt b/tests/010-timeout/001.phpt
index 7389f70..b9886db 100644
--- a/tests/010-timeout/001.phpt
+++ b/tests/010-timeout/001.phpt
@@ -25,13 +25,21 @@ var_dump($s->setReadTimeout(10, 5));
 // Third test, read supposed to return 10.5
 var_dump($s->getReadTimeout());
 
-// Set read timout with the first param as a string, supposed to trigger a warning
-var_dump($s->setReadTimeout(''));
+try {
+	// Set read timout with the first param as a string, supposed to trigger a warning/exception
+	var_dump($s->setReadTimeout(''));
+} catch (TypeError $e) {
+	echo $e->getMessage() . PHP_EOL;
+}
 // Fourth test, read supposed to get the last value set : 10.5
 var_dump($s->getReadTimeout());
 
-// Set read timout with the second param as a string, supposed to trigger a warning
-var_dump($s->setReadTimeout(10, ''));
+try {
+	// Set read timout with the second param as a string, supposed to trigger a warning/exception
+	var_dump($s->setReadTimeout(10, ''));
+} catch (TypeError $e) {
+	echo $e->getMessage() . PHP_EOL;
+}
 // Fourth test, read supposed to get the last value set : 10.5
 var_dump($s->getReadTimeout());
 
@@ -64,18 +72,14 @@ array(2) {
   ["usec"]=>
   int(5)
 }
-
-Warning: Stomp::setReadTimeout() expects parameter 1 to be long, string given in %s on line %d
-NULL
+%AStomp::setReadTimeout()%s1%s string given%A
 array(2) {
   ["sec"]=>
   int(10)
   ["usec"]=>
   int(5)
 }
-
-Warning: Stomp::setReadTimeout() expects parameter 2 to be long, string given in %s on line %d
-NULL
+%AStomp::setReadTimeout()%s2%s string given%A
 array(2) {
   ["sec"]=>
   int(10)
diff --git a/tests/010-timeout/002.phpt b/tests/010-timeout/002.phpt
index a6a9b4a..c22dedf 100644
--- a/tests/010-timeout/002.phpt
+++ b/tests/010-timeout/002.phpt
@@ -25,13 +25,23 @@ var_dump(stomp_set_read_timeout($link, 10, 5));
 // Third test, read supposed to return 10.5
 var_dump(stomp_get_read_timeout($link));
 
-// Set read timout with the first param as a string, supposed to trigger a warning
-var_dump(stomp_set_read_timeout($link, ''));
+try {
+	// Set read timout with the first param as a string, supposed to trigger a warning on PHP 7
+	// supposed to trigger an exception on PHP 8
+	var_dump(stomp_set_read_timeout($link, ''));
+} catch (TypeError $e) {
+	echo $e->getMessage() . PHP_EOL;
+}
 // Fourth test, read supposed to get the last value set : 10.5
 var_dump(stomp_get_read_timeout($link));
 
-// Set read timout with the second param as a string, supposed to trigger a warning
-var_dump(stomp_set_read_timeout($link, 10, ''));
+try {
+	// Set read timout with the second param as a string, supposed to trigger a warning on PHP 7
+	// supposed to trigger an exception on PHP 8
+	var_dump(stomp_set_read_timeout($link, 10, ''));
+} catch (TypeError $e) {
+	echo $e->getMessage() . PHP_EOL;
+}
 // Fourth test, read supposed to get the last value set : 10.5
 var_dump(stomp_get_read_timeout($link));
 
@@ -64,18 +74,14 @@ array(2) {
   ["usec"]=>
   int(5)
 }
-
-Warning: stomp_set_read_timeout() expects parameter 2 to be long, string given in %s on line %d
-NULL
+%Astomp_set_read_timeout()%s2%S string given%A
 array(2) {
   ["sec"]=>
   int(10)
   ["usec"]=>
   int(5)
 }
-
-Warning: stomp_set_read_timeout() expects parameter 3 to be long, string given in %s on line %d
-NULL
+%Astomp_set_read_timeout()%s3%s string given%A
 array(2) {
   ["sec"]=>
   int(10)