Browse Source

fragments/stdclass.php: stdClass isn't a universal base

Brennen Bearnes 2 months ago
parent
commit
292c6b11e7
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      home/fragments/stdclass.php

+ 12
- 0
home/fragments/stdclass.php View File

@@ -0,0 +1,12 @@
1
+<?php
2
+
3
+class foo {
4
+}
5
+
6
+$bar = new foo();
7
+
8
+if ($bar instanceof stdClass) {
9
+  print "stdClass is a base class class for objects.";
10
+} else {
11
+  print "stdClass is not a base class class for objects.";
12
+}

Loading…
Cancel
Save