File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,17 @@ $stringableObject = new class () implements Stringable {
22
22
};
23
23
24
24
echo "Stringable object, value set after bindParam: \n" ;
25
-
26
- $ stmt = $ db ->prepare ('SELECT ? ' );
27
- $ param = 'foo ' ;
28
- $ stmt ->bindParam (1 , $ param , PDO ::PARAM_STR );
29
- $ param = $ stringableObject ;
30
- $ stmt ->execute ();
31
- var_dump (is_object ($ param ), $ param === $ stringableObject );
32
- echo "\n" ;
33
-
25
+ try {
26
+ $ stmt = $ db ->prepare ('SELECT ? ' );
27
+ $ param = 'foo ' ;
28
+ $ stmt ->bindParam (1 , $ param , PDO ::PARAM_STR );
29
+ $ param = $ stringableObject ;
30
+ $ stmt ->execute ();
31
+ var_dump (is_object ($ param ), $ param === $ stringableObject );
32
+ echo "\n" ;
33
+ } catch (Throwable $ e ) {
34
+ echo $ e ->getMessage ()."\n\n" ;
35
+ }
34
36
35
37
echo "Stringable object, bindValue: \n" ;
36
38
$ stmt = $ db ->prepare ('SELECT (?) ' );
You can’t perform that action at this time.
0 commit comments