summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-03-14 05:42:27 +0000
committer <>2013-04-03 16:25:08 +0000
commitc4dd7a1a684490673e25aaf4fabec5df138854c4 (patch)
tree4d57c44caae4480efff02b90b9be86f44bf25409 /tests
downloadphp2-c4dd7a1a684490673e25aaf4fabec5df138854c4.tar.gz
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/001.phpt6
-rw-r--r--tests/basic/002.phpt9
-rw-r--r--tests/basic/003.phpt12
-rw-r--r--tests/basic/004.phpt10
-rw-r--r--tests/basic/005.phpt10
-rw-r--r--tests/basic/006.phpt6
-rw-r--r--tests/basic/007.phpt6
-rw-r--r--tests/basic/008.phpt6
-rw-r--r--tests/basic/009.phpt6
-rw-r--r--tests/basic/010.phpt6
-rw-r--r--tests/basic/011.phpt22
-rw-r--r--tests/basic/012.phpt25
-rw-r--r--tests/basic/013.phpt13
-rw-r--r--tests/basic/014.phpt15
-rw-r--r--tests/basic/015.phpt13
-rw-r--r--tests/basic/016.phpt15
-rw-r--r--tests/basic/017.phpt17
-rw-r--r--tests/basic/018.phpt34
-rw-r--r--tests/basic/019.phpt17
-rw-r--r--tests/basic/020.phpt15
-rw-r--r--tests/basic/021.phpt43
-rw-r--r--tests/basic/022.phpt34
-rw-r--r--tests/basic/023.phpt20
-rw-r--r--tests/basic/024.phpt28
-rw-r--r--tests/basic/025.phpt20
-rw-r--r--tests/basic/026.phpt15
-rw-r--r--tests/basic/027.phpt33
-rw-r--r--tests/basic/028.phpt105
-rw-r--r--tests/basic/029.phpt51
-rw-r--r--tests/basic/030.phpt20
-rw-r--r--tests/basic/031.phpt32
-rw-r--r--tests/basic/032.phpt20
-rw-r--r--tests/basic/bug20539.phpt20
-rw-r--r--tests/basic/bug29971.phpt15
-rw-r--r--tests/basic/bug45986.phpt12
-rw-r--r--tests/basic/bug51709_1.phpt16
-rw-r--r--tests/basic/bug51709_2.phpt16
-rw-r--r--tests/basic/bug53180.phpt19
-rw-r--r--tests/basic/bug54514.phpt12
-rw-r--r--tests/basic/bug55500.phpt68
-rw-r--r--tests/basic/bug61000.phpt19
-rw-r--r--tests/basic/enable_post_data_reading_01.phpt22
-rw-r--r--tests/basic/enable_post_data_reading_02.phpt28
-rw-r--r--tests/basic/enable_post_data_reading_03.phpt23
-rw-r--r--tests/basic/enable_post_data_reading_04.phpt23
-rw-r--r--tests/basic/php_egg_logo_guid.phpt13
-rw-r--r--tests/basic/php_logo_guid.phpt10
-rw-r--r--tests/basic/php_real_logo_guid.phpt12
-rw-r--r--tests/basic/req44164.phpt17
-rw-r--r--tests/basic/rfc1867_anonymous_upload.phpt57
-rw-r--r--tests/basic/rfc1867_array_upload.phpt84
-rw-r--r--tests/basic/rfc1867_boundary_1.phpt25
-rw-r--r--tests/basic/rfc1867_boundary_2.phpt25
-rw-r--r--tests/basic/rfc1867_empty_upload.phpt89
-rw-r--r--tests/basic/rfc1867_file_upload_disabled.phpt36
-rw-r--r--tests/basic/rfc1867_garbled_mime_headers.phpt25
-rw-r--r--tests/basic/rfc1867_invalid_boundary.phpt24
-rw-r--r--tests/basic/rfc1867_malicious_input.phpt25
-rw-r--r--tests/basic/rfc1867_max_file_size.phpt89
-rw-r--r--tests/basic/rfc1867_max_file_uploads_empty_files.phpt101
-rw-r--r--tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt102
-rw-r--r--tests/basic/rfc1867_missing_boundary.phpt24
-rw-r--r--tests/basic/rfc1867_missing_boundary_2.phpt37
-rw-r--r--tests/basic/rfc1867_post_max_filesize.phpt83
-rw-r--r--tests/basic/rfc1867_post_max_size.phpt24
-rw-r--r--tests/basic/zend_logo_guid.phpt13
-rw-r--r--tests/classes/__call_001.phpt42
-rw-r--r--tests/classes/__call_002.phpt15
-rw-r--r--tests/classes/__call_003.phpt33
-rw-r--r--tests/classes/__call_004.phpt41
-rw-r--r--tests/classes/__call_005.phpt37
-rw-r--r--tests/classes/__call_006.phpt77
-rw-r--r--tests/classes/__call_007.phpt74
-rw-r--r--tests/classes/__set__get_001.phpt72
-rw-r--r--tests/classes/__set__get_002.phpt14
-rw-r--r--tests/classes/__set__get_003.phpt14
-rw-r--r--tests/classes/__set__get_004.phpt39
-rw-r--r--tests/classes/__set__get_005.phpt68
-rw-r--r--tests/classes/__set_data_corrupt.phpt29
-rw-r--r--tests/classes/abstract.phpt30
-rw-r--r--tests/classes/abstract_by_interface_001.phpt33
-rw-r--r--tests/classes/abstract_by_interface_002.phpt33
-rw-r--r--tests/classes/abstract_class.phpt29
-rw-r--r--tests/classes/abstract_derived.phpt20
-rw-r--r--tests/classes/abstract_final.phpt16
-rw-r--r--tests/classes/abstract_inherit.phpt22
-rw-r--r--tests/classes/abstract_not_declared.phpt15
-rw-r--r--tests/classes/abstract_redeclare.phpt22
-rw-r--r--tests/classes/abstract_static.phpt36
-rw-r--r--tests/classes/abstract_user_call.phpt30
-rw-r--r--tests/classes/array_access_001.phpt198
-rw-r--r--tests/classes/array_access_002.phpt198
-rw-r--r--tests/classes/array_access_003.phpt59
-rw-r--r--tests/classes/array_access_004.phpt57
-rw-r--r--tests/classes/array_access_005.phpt77
-rw-r--r--tests/classes/array_access_006.phpt37
-rw-r--r--tests/classes/array_access_007.phpt57
-rw-r--r--tests/classes/array_access_008.phpt67
-rw-r--r--tests/classes/array_access_009.phpt190
-rw-r--r--tests/classes/array_access_010.phpt168
-rw-r--r--tests/classes/array_access_011.phpt187
-rw-r--r--tests/classes/array_access_012.phpt36
-rw-r--r--tests/classes/array_access_013.phpt58
-rw-r--r--tests/classes/arrayobject_001.phpt13
-rw-r--r--tests/classes/assign_op_property_001.phpt31
-rw-r--r--tests/classes/autoload_001.phpt24
-rw-r--r--tests/classes/autoload_002.phpt27
-rw-r--r--tests/classes/autoload_003.phpt25
-rw-r--r--tests/classes/autoload_004.phpt28
-rw-r--r--tests/classes/autoload_005.phpt45
-rw-r--r--tests/classes/autoload_006.phpt40
-rw-r--r--tests/classes/autoload_007.phpt15
-rw-r--r--tests/classes/autoload_008.phpt26
-rw-r--r--tests/classes/autoload_009.phpt20
-rw-r--r--tests/classes/autoload_010.phpt18
-rw-r--r--tests/classes/autoload_011.phpt18
-rw-r--r--tests/classes/autoload_012.phpt15
-rw-r--r--tests/classes/autoload_013.phpt22
-rw-r--r--tests/classes/autoload_014.phpt22
-rw-r--r--tests/classes/autoload_015.phpt22
-rw-r--r--tests/classes/autoload_016.phpt23
-rw-r--r--tests/classes/autoload_017.phpt23
-rw-r--r--tests/classes/autoload_018.phpt48
-rw-r--r--tests/classes/autoload_019.phpt14
-rw-r--r--tests/classes/autoload_020.phpt17
-rwxr-xr-xtests/classes/autoload_derived.p5c6
-rwxr-xr-xtests/classes/autoload_implements.p5c10
-rwxr-xr-xtests/classes/autoload_interface.p5c7
-rwxr-xr-xtests/classes/autoload_root.p5c10
-rw-r--r--tests/classes/bug23951.phpt44
-rw-r--r--tests/classes/bug24399.phpt12
-rw-r--r--tests/classes/bug24445.phpt12
-rw-r--r--tests/classes/bug26737.phpt22
-rw-r--r--tests/classes/bug27468.phpt17
-rw-r--r--tests/classes/bug27504.phpt25
-rw-r--r--tests/classes/bug29446.phpt19
-rw-r--r--tests/classes/bug63462.phpt71
-rw-r--r--tests/classes/class_abstract.phpt28
-rw-r--r--tests/classes/class_example.phpt85
-rw-r--r--tests/classes/class_final.phpt22
-rw-r--r--tests/classes/class_stdclass.phpt14
-rw-r--r--tests/classes/clone_001.phpt43
-rw-r--r--tests/classes/clone_002.phpt45
-rw-r--r--tests/classes/clone_003.phpt58
-rw-r--r--tests/classes/clone_004.phpt82
-rw-r--r--tests/classes/clone_005.phpt19
-rw-r--r--tests/classes/clone_006.phpt41
-rw-r--r--tests/classes/constants_basic_001.phpt89
-rw-r--r--tests/classes/constants_basic_002.phpt32
-rw-r--r--tests/classes/constants_basic_003.inc5
-rw-r--r--tests/classes/constants_basic_003.phpt28
-rw-r--r--tests/classes/constants_basic_004.phpt99
-rw-r--r--tests/classes/constants_basic_005.phpt16
-rw-r--r--tests/classes/constants_basic_006.phpt43
-rw-r--r--tests/classes/constants_error_001.phpt13
-rw-r--r--tests/classes/constants_error_002.phpt12
-rw-r--r--tests/classes/constants_error_003.phpt20
-rw-r--r--tests/classes/constants_error_004.phpt13
-rw-r--r--tests/classes/constants_error_005.phpt12
-rw-r--r--tests/classes/constants_error_006.phpt16
-rw-r--r--tests/classes/constants_error_007.phpt15
-rw-r--r--tests/classes/constants_scope_001.phpt38
-rw-r--r--tests/classes/ctor_dtor.phpt40
-rw-r--r--tests/classes/ctor_dtor_inheritance.phpt99
-rw-r--r--tests/classes/ctor_failure.phpt33
-rw-r--r--tests/classes/ctor_in_interface_01.phpt19
-rw-r--r--tests/classes/ctor_in_interface_02.phpt34
-rw-r--r--tests/classes/ctor_in_interface_03.phpt23
-rw-r--r--tests/classes/ctor_in_interface_04.phpt26
-rw-r--r--tests/classes/ctor_name_clash.phpt22
-rw-r--r--tests/classes/ctor_visibility.phpt69
-rw-r--r--tests/classes/dereferencing_001.phpt35
-rw-r--r--tests/classes/destructor_and_echo.phpt24
-rw-r--r--tests/classes/destructor_and_exceptions.phpt60
-rw-r--r--tests/classes/destructor_and_globals.phpt56
-rw-r--r--tests/classes/destructor_and_references.phpt26
-rw-r--r--tests/classes/destructor_inheritance.phpt29
-rw-r--r--tests/classes/destructor_visibility_001.phpt24
-rw-r--r--tests/classes/destructor_visibility_002.phpt24
-rw-r--r--tests/classes/destructor_visibility_003.phpt28
-rw-r--r--tests/classes/factory_001.phpt35
-rw-r--r--tests/classes/factory_and_singleton_001.phpt101
-rw-r--r--tests/classes/factory_and_singleton_002.phpt100
-rw-r--r--tests/classes/factory_and_singleton_003.phpt18
-rw-r--r--tests/classes/factory_and_singleton_004.phpt18
-rw-r--r--tests/classes/factory_and_singleton_005.phpt19
-rw-r--r--tests/classes/factory_and_singleton_006.phpt20
-rw-r--r--tests/classes/factory_and_singleton_007.phpt20
-rw-r--r--tests/classes/factory_and_singleton_008.phpt20
-rw-r--r--tests/classes/factory_and_singleton_009.phpt21
-rw-r--r--tests/classes/factory_and_singleton_010.phpt21
-rw-r--r--tests/classes/final.phpt31
-rw-r--r--tests/classes/final_abstract.phpt16
-rw-r--r--tests/classes/final_ctor1.phpt29
-rw-r--r--tests/classes/final_ctor2.phpt29
-rw-r--r--tests/classes/final_ctor3.phpt13
-rw-r--r--tests/classes/final_redeclare.phpt25
-rw-r--r--tests/classes/implicit_instantiation_001.phpt146
-rw-r--r--tests/classes/incdec_property_001.phpt31
-rw-r--r--tests/classes/incdec_property_002.phpt31
-rw-r--r--tests/classes/incdec_property_003.phpt31
-rw-r--r--tests/classes/incdec_property_004.phpt31
-rw-r--r--tests/classes/inheritance.phpt56
-rw-r--r--tests/classes/inheritance_002.phpt71
-rw-r--r--tests/classes/inheritance_003.phpt21
-rw-r--r--tests/classes/inheritance_004.phpt21
-rw-r--r--tests/classes/inheritance_005.phpt57
-rw-r--r--tests/classes/inheritance_006.phpt24
-rw-r--r--tests/classes/inheritance_007.phpt39
-rw-r--r--tests/classes/interface_and_extends.phpt26
-rw-r--r--tests/classes/interface_class.phpt14
-rw-r--r--tests/classes/interface_constant_inheritance_001.phpt17
-rw-r--r--tests/classes/interface_constant_inheritance_002.phpt17
-rw-r--r--tests/classes/interface_constant_inheritance_003.phpt20
-rw-r--r--tests/classes/interface_constant_inheritance_004.phpt18
-rw-r--r--tests/classes/interface_doubled.phpt201
-rw-r--r--tests/classes/interface_implemented.phpt103
-rw-r--r--tests/classes/interface_instantiate.phpt16
-rw-r--r--tests/classes/interface_member.phpt13
-rw-r--r--tests/classes/interface_method.phpt15
-rw-r--r--tests/classes/interface_method_final.phpt15
-rw-r--r--tests/classes/interface_method_private.phpt15
-rw-r--r--tests/classes/interface_must_be_implemented.phpt17
-rw-r--r--tests/classes/interface_optional_arg.phpt27
-rw-r--r--tests/classes/interface_optional_arg_002.phpt24
-rw-r--r--tests/classes/interface_optional_arg_003.inc4
-rw-r--r--tests/classes/interface_optional_arg_003.phpt17
-rw-r--r--tests/classes/interfaces_001.phpt26
-rw-r--r--tests/classes/interfaces_002.phpt29
-rw-r--r--tests/classes/interfaces_003.phpt26
-rw-r--r--tests/classes/iterators_001.phpt200
-rw-r--r--tests/classes/iterators_002.phpt113
-rw-r--r--tests/classes/iterators_003.phpt115
-rw-r--r--tests/classes/iterators_004.phpt61
-rw-r--r--tests/classes/iterators_005.phpt19
-rw-r--r--tests/classes/iterators_006.phpt87
-rw-r--r--tests/classes/iterators_007.phpt43
-rw-r--r--tests/classes/iterators_008.phpt45
-rw-r--r--tests/classes/method_call_variation_001.phpt37
-rw-r--r--tests/classes/method_override_optional_arg_001.phpt33
-rw-r--r--tests/classes/method_override_optional_arg_002.phpt22
-rw-r--r--tests/classes/new_001.phpt48
-rw-r--r--tests/classes/object_reference_001.phpt27
-rw-r--r--tests/classes/private_001.phpt26
-rw-r--r--tests/classes/private_002.phpt35
-rw-r--r--tests/classes/private_003.phpt36
-rw-r--r--tests/classes/private_003b.phpt37
-rw-r--r--tests/classes/private_004.phpt32
-rw-r--r--tests/classes/private_004b.phpt35
-rw-r--r--tests/classes/private_005.phpt32
-rw-r--r--tests/classes/private_005b.phpt35
-rw-r--r--tests/classes/private_006.phpt41
-rw-r--r--tests/classes/private_006b.phpt41
-rw-r--r--tests/classes/private_007.phpt30
-rw-r--r--tests/classes/private_007b.phpt31
-rw-r--r--tests/classes/private_members.phpt103
-rw-r--r--tests/classes/private_redeclare.phpt38
-rw-r--r--tests/classes/property_override_privateStatic_private.phpt33
-rw-r--r--tests/classes/property_override_privateStatic_privateStatic.phpt32
-rw-r--r--tests/classes/property_override_privateStatic_protected.phpt33
-rw-r--r--tests/classes/property_override_privateStatic_protectedStatic.phpt32
-rw-r--r--tests/classes/property_override_privateStatic_public.phpt33
-rw-r--r--tests/classes/property_override_privateStatic_publicStatic.phpt32
-rw-r--r--tests/classes/property_override_private_private.phpt34
-rw-r--r--tests/classes/property_override_private_privateStatic.phpt34
-rw-r--r--tests/classes/property_override_private_protected.phpt34
-rw-r--r--tests/classes/property_override_private_protectedStatic.phpt34
-rw-r--r--tests/classes/property_override_private_public.phpt34
-rw-r--r--tests/classes/property_override_private_publicStatic.phpt34
-rw-r--r--tests/classes/property_override_protectedStatic_private.phpt33
-rw-r--r--tests/classes/property_override_protectedStatic_privateStatic.phpt32
-rw-r--r--tests/classes/property_override_protectedStatic_protected.phpt33
-rw-r--r--tests/classes/property_override_protectedStatic_protectedStatic.phpt32
-rw-r--r--tests/classes/property_override_protectedStatic_public.phpt33
-rw-r--r--tests/classes/property_override_protectedStatic_publicStatic.phpt33
-rw-r--r--tests/classes/property_override_protected_private.phpt33
-rw-r--r--tests/classes/property_override_protected_privateStatic.phpt33
-rw-r--r--tests/classes/property_override_protected_protected.phpt34
-rw-r--r--tests/classes/property_override_protected_protectedStatic.phpt33
-rw-r--r--tests/classes/property_override_protected_public.phpt34
-rw-r--r--tests/classes/property_override_protected_publicStatic.phpt33
-rw-r--r--tests/classes/property_override_publicStatic_private.phpt33
-rw-r--r--tests/classes/property_override_publicStatic_privateStatic.phpt32
-rw-r--r--tests/classes/property_override_publicStatic_protected.phpt33
-rw-r--r--tests/classes/property_override_publicStatic_protectedStatic.phpt32
-rw-r--r--tests/classes/property_override_publicStatic_public.phpt33
-rw-r--r--tests/classes/property_override_publicStatic_publicStatic.phpt32
-rw-r--r--tests/classes/property_override_public_private.phpt34
-rw-r--r--tests/classes/property_override_public_privateStatic.phpt33
-rw-r--r--tests/classes/property_override_public_protected.phpt34
-rw-r--r--tests/classes/property_override_public_protectedStatic.phpt33
-rw-r--r--tests/classes/property_override_public_public.phpt34
-rw-r--r--tests/classes/property_override_public_publicStatic.phpt33
-rw-r--r--tests/classes/property_recreate_private.phpt81
-rw-r--r--tests/classes/property_recreate_protected.phpt53
-rw-r--r--tests/classes/protected_001.phpt26
-rw-r--r--tests/classes/protected_001b.phpt27
-rw-r--r--tests/classes/protected_002.phpt35
-rw-r--r--tests/classes/serialize_001.phpt79
-rw-r--r--tests/classes/singleton_001.phpt37
-rw-r--r--tests/classes/static_mix_1.phpt26
-rw-r--r--tests/classes/static_mix_2.phpt27
-rw-r--r--tests/classes/static_properties_001.phpt27
-rw-r--r--tests/classes/static_properties_003.phpt49
-rw-r--r--tests/classes/static_properties_003_error1.phpt18
-rw-r--r--tests/classes/static_properties_003_error2.phpt18
-rw-r--r--tests/classes/static_properties_003_error3.phpt18
-rw-r--r--tests/classes/static_properties_003_error4.phpt18
-rw-r--r--tests/classes/static_properties_004.phpt37
-rw-r--r--tests/classes/static_properties_undeclared_assign.phpt9
-rw-r--r--tests/classes/static_properties_undeclared_assignInc.phpt9
-rw-r--r--tests/classes/static_properties_undeclared_assignRef.phpt10
-rw-r--r--tests/classes/static_properties_undeclared_inc.phpt9
-rw-r--r--tests/classes/static_properties_undeclared_isset.phpt9
-rw-r--r--tests/classes/static_properties_undeclared_read.phpt9
-rw-r--r--tests/classes/static_this.phpt39
-rw-r--r--tests/classes/this.phpt54
-rw-r--r--tests/classes/tostring_001.phpt130
-rw-r--r--tests/classes/tostring_002.phpt31
-rw-r--r--tests/classes/tostring_003.phpt33
-rw-r--r--tests/classes/tostring_004.phpt56
-rw-r--r--tests/classes/type_hinting_001.phpt38
-rw-r--r--tests/classes/type_hinting_002.phpt16
-rw-r--r--tests/classes/type_hinting_003.phpt60
-rw-r--r--tests/classes/type_hinting_004.phpt109
-rw-r--r--tests/classes/type_hinting_005a.phpt18
-rw-r--r--tests/classes/type_hinting_005b.phpt14
-rw-r--r--tests/classes/type_hinting_005c.phpt14
-rw-r--r--tests/classes/type_hinting_005d.phpt14
-rw-r--r--tests/classes/unset_properties.phpt154
-rw-r--r--tests/classes/visibility_000a.phpt33
-rw-r--r--tests/classes/visibility_000b.phpt33
-rw-r--r--tests/classes/visibility_000c.phpt33
-rw-r--r--tests/classes/visibility_001a.phpt33
-rw-r--r--tests/classes/visibility_001b.phpt33
-rw-r--r--tests/classes/visibility_001c.phpt33
-rw-r--r--tests/classes/visibility_002a.phpt33
-rw-r--r--tests/classes/visibility_002b.phpt33
-rw-r--r--tests/classes/visibility_002c.phpt33
-rw-r--r--tests/classes/visibility_003a.phpt33
-rw-r--r--tests/classes/visibility_003b.phpt33
-rw-r--r--tests/classes/visibility_003c.phpt33
-rw-r--r--tests/classes/visibility_004a.phpt33
-rw-r--r--tests/classes/visibility_004b.phpt33
-rw-r--r--tests/classes/visibility_004c.phpt33
-rw-r--r--tests/classes/visibility_005.phpt59
-rw-r--r--tests/func/001.phpt6
-rw-r--r--tests/func/002.phpt21
-rw-r--r--tests/func/003.phpt291
-rw-r--r--tests/func/004.phpt65
-rw-r--r--tests/func/005.phpt19
-rw-r--r--tests/func/005a.phpt32
-rw-r--r--tests/func/006.phpt26
-rw-r--r--tests/func/007.phpt22
-rw-r--r--tests/func/008.phpt16
-rw-r--r--tests/func/009.phpt16
-rw-r--r--tests/func/010.phpt77
-rw-r--r--tests/func/ini_alter.phpt19
-rw-r--r--tests/lang/001.phpt6
-rw-r--r--tests/lang/002.phpt12
-rw-r--r--tests/lang/003.phpt19
-rw-r--r--tests/lang/004.phpt13
-rw-r--r--tests/lang/005.phpt16
-rw-r--r--tests/lang/006.phpt23
-rw-r--r--tests/lang/007.phpt27
-rw-r--r--tests/lang/008.phpt18
-rw-r--r--tests/lang/009.phpt11
-rw-r--r--tests/lang/010.phpt13
-rw-r--r--tests/lang/011.phpt23
-rw-r--r--tests/lang/012.phpt18
-rw-r--r--tests/lang/013.phpt10
-rw-r--r--tests/lang/014.phpt13
-rw-r--r--tests/lang/015.inc3
-rw-r--r--tests/lang/015.phpt8
-rw-r--r--tests/lang/016.inc5
-rw-r--r--tests/lang/016.phpt9
-rw-r--r--tests/lang/017.phpt18
-rw-r--r--tests/lang/018.phpt34
-rw-r--r--tests/lang/019.phpt38
-rw-r--r--tests/lang/020.phpt76
-rw-r--r--tests/lang/021.phpt42
-rw-r--r--tests/lang/022.phpt63
-rw-r--r--tests/lang/023-1.inc356
-rw-r--r--tests/lang/023-2.inc6
-rw-r--r--tests/lang/023.phpt256
-rw-r--r--tests/lang/024.phpt11623
-rw-r--r--tests/lang/025.phpt531
-rw-r--r--tests/lang/026.phpt6
-rw-r--r--tests/lang/027.phpt12
-rw-r--r--tests/lang/028.phpt1058
-rw-r--r--tests/lang/030.phpt36
-rw-r--r--tests/lang/031.phpt70
-rw-r--r--tests/lang/032.phpt36
-rw-r--r--tests/lang/033.phpt47
-rw-r--r--tests/lang/034.phpt23
-rw-r--r--tests/lang/035.phpt38
-rw-r--r--tests/lang/036.phpt27
-rw-r--r--tests/lang/037.phpt30
-rw-r--r--tests/lang/038.phpt41
-rw-r--r--tests/lang/039.phpt45
-rw-r--r--tests/lang/040.phpt15
-rw-r--r--tests/lang/041.phpt20
-rw-r--r--tests/lang/042.phpt19
-rw-r--r--tests/lang/043.phpt19
-rw-r--r--tests/lang/044.phpt21
-rw-r--r--tests/lang/045.phpt27
-rw-r--r--tests/lang/array_shortcut_001.phpt13
-rw-r--r--tests/lang/array_shortcut_002.phpt13
-rw-r--r--tests/lang/array_shortcut_003.phpt13
-rw-r--r--tests/lang/array_shortcut_005.phpt20
-rw-r--r--tests/lang/bison1.phpt9
-rw-r--r--tests/lang/bug17115.phpt16
-rw-r--r--tests/lang/bug18872.phpt18
-rw-r--r--tests/lang/bug19566.phpt10
-rw-r--r--tests/lang/bug19943.phpt29
-rw-r--r--tests/lang/bug20175.phpt169
-rw-r--r--tests/lang/bug21094.phpt17
-rw-r--r--tests/lang/bug21600.phpt39
-rw-r--r--tests/lang/bug21669.phpt23
-rw-r--r--tests/lang/bug21820.phpt13
-rw-r--r--tests/lang/bug21849.phpt16
-rw-r--r--tests/lang/bug21961.phpt58
-rw-r--r--tests/lang/bug22231.phpt42
-rw-r--r--tests/lang/bug22510.phpt126
-rw-r--r--tests/lang/bug22592.phpt53
-rw-r--r--tests/lang/bug22690.phpt12
-rw-r--r--tests/lang/bug23279.phpt16
-rw-r--r--tests/lang/bug23384.phpt33
-rw-r--r--tests/lang/bug23489.phpt23
-rw-r--r--tests/lang/bug23524.phpt29
-rw-r--r--tests/lang/bug23584.phpt13
-rw-r--r--tests/lang/bug23624.phpt12
-rw-r--r--tests/lang/bug23922.phpt20
-rw-r--r--tests/lang/bug24054.phpt24
-rw-r--r--tests/lang/bug24396.phpt19
-rw-r--r--tests/lang/bug24403.phpt20
-rw-r--r--tests/lang/bug24436.phpt15
-rw-r--r--tests/lang/bug24499.phpt24
-rw-r--r--tests/lang/bug24573.phpt24
-rw-r--r--tests/lang/bug24640.phpt129
-rw-r--r--tests/lang/bug24652.phpt31
-rw-r--r--tests/lang/bug24658.phpt56
-rw-r--r--tests/lang/bug24783.phpt13
-rw-r--r--tests/lang/bug24908.phpt18
-rw-r--r--tests/lang/bug24926.phpt28
-rw-r--r--tests/lang/bug24951.phpt42
-rw-r--r--tests/lang/bug25145.phpt20
-rw-r--r--tests/lang/bug25547.phpt30
-rw-r--r--tests/lang/bug25652.phpt22
-rw-r--r--tests/lang/bug25922.phpt23
-rw-r--r--tests/lang/bug26182.phpt25
-rw-r--r--tests/lang/bug26696.phpt28
-rw-r--r--tests/lang/bug26866.phpt25
-rw-r--r--tests/lang/bug26869.phpt15
-rw-r--r--tests/lang/bug27354.phpt14
-rw-r--r--tests/lang/bug27439.phpt76
-rw-r--r--tests/lang/bug27443.phpt8
-rw-r--r--tests/lang/bug27535.phpt28
-rw-r--r--tests/lang/bug28213.phpt10
-rw-r--r--tests/lang/bug28800.phpt17
-rw-r--r--tests/lang/bug29566.phpt18
-rw-r--r--tests/lang/bug29893.phpt11
-rw-r--r--tests/lang/bug29944.phpt20
-rw-r--r--tests/lang/bug30578.phpt31
-rw-r--r--tests/lang/bug30638.phpt26
-rw-r--r--tests/lang/bug30726.phpt8
-rw-r--r--tests/lang/bug30862.phpt30
-rw-r--r--tests/lang/bug32828.phpt21
-rw-r--r--tests/lang/bug32924.phpt14
-rw-r--r--tests/lang/bug35176.phpt15
-rw-r--r--tests/lang/bug35382.phpt9
-rw-r--r--tests/lang/bug38579.inc3
-rw-r--r--tests/lang/bug38579.phpt16
-rw-r--r--tests/lang/bug43958.phpt17
-rw-r--r--tests/lang/bug44654.phpt8
-rw-r--r--tests/lang/bug44827.phpt17
-rw-r--r--tests/lang/bug45392.phpt23
-rw-r--r--tests/lang/bug55754.phpt14
-rw-r--r--tests/lang/bug7515.phpt37
-rw-r--r--tests/lang/catchable_error_001.phpt22
-rw-r--r--tests/lang/catchable_error_002.phpt37
-rw-r--r--tests/lang/comments.phpt24
-rw-r--r--tests/lang/comments2.phpt9
-rw-r--r--tests/lang/compare_objects_basic1.phpt60
-rw-r--r--tests/lang/compare_objects_basic2.phpt24
-rw-r--r--tests/lang/each_binary_safety.phpt13
-rw-r--r--tests/lang/empty_variation.phpt14
-rw-r--r--tests/lang/engine_assignExecutionOrder_001.phpt152
-rw-r--r--tests/lang/engine_assignExecutionOrder_002.phpt135
-rw-r--r--tests/lang/engine_assignExecutionOrder_003.phpt96
-rw-r--r--tests/lang/engine_assignExecutionOrder_004.phpt52
-rw-r--r--tests/lang/engine_assignExecutionOrder_005.phpt74
-rw-r--r--tests/lang/engine_assignExecutionOrder_006.phpt138
-rw-r--r--tests/lang/engine_assignExecutionOrder_007.phpt46
-rw-r--r--tests/lang/engine_assignExecutionOrder_008.phpt81
-rw-r--r--tests/lang/engine_assignExecutionOrder_009.phpt36
-rw-r--r--tests/lang/error_2_exception_001.phpt45
-rw-r--r--tests/lang/execution_order.phpt198
-rw-r--r--tests/lang/foreachLoop.001.phpt64
-rw-r--r--tests/lang/foreachLoop.002.phpt173
-rw-r--r--tests/lang/foreachLoop.003.phpt46
-rw-r--r--tests/lang/foreachLoop.004.phpt76
-rw-r--r--tests/lang/foreachLoop.005.phpt23
-rw-r--r--tests/lang/foreachLoop.006.phpt11
-rw-r--r--tests/lang/foreachLoop.007.phpt11
-rw-r--r--tests/lang/foreachLoop.008.phpt10
-rw-r--r--tests/lang/foreachLoop.009.phpt82
-rw-r--r--tests/lang/foreachLoop.010.phpt40
-rw-r--r--tests/lang/foreachLoop.011.phpt34
-rw-r--r--tests/lang/foreachLoop.012.phpt494
-rw-r--r--tests/lang/foreachLoop.013.phpt555
-rw-r--r--tests/lang/foreachLoop.014.phpt556
-rw-r--r--tests/lang/foreachLoop.015.phpt557
-rw-r--r--tests/lang/foreachLoop.016.phpt206
-rw-r--r--tests/lang/foreachLoop.017.phpt11
-rw-r--r--tests/lang/foreachLoopIterator.001.phpt134
-rw-r--r--tests/lang/foreachLoopIterator.002.phpt24
-rw-r--r--tests/lang/foreachLoopIteratorAggregate.001.phpt270
-rw-r--r--tests/lang/foreachLoopIteratorAggregate.002.phpt53
-rw-r--r--tests/lang/foreachLoopIteratorAggregate.003.phpt133
-rw-r--r--tests/lang/foreachLoopIteratorAggregate.004.phpt104
-rw-r--r--tests/lang/foreachLoopObjects.001.phpt69
-rw-r--r--tests/lang/foreachLoopObjects.002.phpt587
-rw-r--r--tests/lang/foreachLoopObjects.003.phpt250
-rw-r--r--tests/lang/foreachLoopObjects.004.phpt55
-rw-r--r--tests/lang/foreachLoopObjects.005.phpt78
-rw-r--r--tests/lang/foreachLoopObjects.006.phpt147
-rw-r--r--tests/lang/foreach_with_object_001.phpt25
-rw-r--r--tests/lang/foreach_with_references_001.phpt32
-rw-r--r--tests/lang/func_get_arg.001.phpt15
-rw-r--r--tests/lang/func_get_arg.002.phpt19
-rw-r--r--tests/lang/func_get_arg.003.phpt11
-rw-r--r--tests/lang/func_get_arg.004.phpt16
-rw-r--r--tests/lang/func_get_arg.005.phpt19
-rw-r--r--tests/lang/func_get_arg_variation.phpt28
-rw-r--r--tests/lang/func_get_args.001.phpt15
-rw-r--r--tests/lang/func_get_args.002.phpt22
-rw-r--r--tests/lang/func_get_args.003.phpt11
-rw-r--r--tests/lang/func_get_args.004.phpt67
-rw-r--r--tests/lang/func_num_args.001.phpt14
-rw-r--r--tests/lang/func_num_args.002.phpt14
-rw-r--r--tests/lang/func_num_args.003.phpt12
-rw-r--r--tests/lang/func_num_args.004.phpt48
-rw-r--r--tests/lang/inc.inc3
-rw-r--r--tests/lang/inc_throw.inc5
-rw-r--r--tests/lang/include_files/echo.inc3
-rw-r--r--tests/lang/include_files/eval.inc3
-rw-r--r--tests/lang/include_files/function.inc3
-rw-r--r--tests/lang/include_variation1.phpt8
-rw-r--r--tests/lang/include_variation2.phpt9
-rw-r--r--tests/lang/include_variation3.phpt8
-rw-r--r--tests/lang/operators/add_basiclong_64bit.phpt582
-rw-r--r--tests/lang/operators/add_variationStr.phpt416
-rw-r--r--tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt582
-rw-r--r--tests/lang/operators/bitwiseAnd_variationStr.phpt416
-rw-r--r--tests/lang/operators/bitwiseNot_basiclong_64bit.phpt60
-rw-r--r--tests/lang/operators/bitwiseNot_variationStr.phpt48
-rw-r--r--tests/lang/operators/bitwiseOr_basiclong_64bit.phpt583
-rw-r--r--tests/lang/operators/bitwiseOr_variationStr.phpt416
-rw-r--r--tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt583
-rw-r--r--tests/lang/operators/bitwiseShiftLeft_variationStr.phpt421
-rw-r--r--tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt420
-rw-r--r--tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt583
-rw-r--r--tests/lang/operators/bitwiseShiftRight_variationStr.phpt416
-rw-r--r--tests/lang/operators/bitwiseXor_basiclong_64bit.phpt583
-rw-r--r--tests/lang/operators/bitwiseXor_variationStr.phpt416
-rw-r--r--tests/lang/operators/divide_basiclong_64bit.phpt582
-rw-r--r--tests/lang/operators/divide_variationStr.phpt416
-rw-r--r--tests/lang/operators/modulus_basiclong_64bit.phpt582
-rw-r--r--tests/lang/operators/modulus_variationStr.phpt416
-rw-r--r--tests/lang/operators/multiply_basiclong_64bit.phpt582
-rw-r--r--tests/lang/operators/multiply_variationStr.phpt416
-rw-r--r--tests/lang/operators/negate_basiclong_64bit.phpt60
-rw-r--r--tests/lang/operators/negate_variationStr.phpt48
-rw-r--r--tests/lang/operators/operator_equals_basic.phpt65
-rw-r--r--tests/lang/operators/operator_equals_variation.phpt63
-rw-r--r--tests/lang/operators/operator_equals_variation_64bit.phpt65
-rw-r--r--tests/lang/operators/operator_gt_basic.phpt65
-rw-r--r--tests/lang/operators/operator_gt_or_equal_basic.phpt65
-rw-r--r--tests/lang/operators/operator_gt_or_equal_variation.phpt63
-rw-r--r--tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt63
-rw-r--r--tests/lang/operators/operator_gt_variation.phpt62
-rw-r--r--tests/lang/operators/operator_gt_variation_64bit.phpt62
-rw-r--r--tests/lang/operators/operator_identical_basic.phpt65
-rw-r--r--tests/lang/operators/operator_identical_variation.phpt63
-rw-r--r--tests/lang/operators/operator_identical_variation_64bit.phpt65
-rw-r--r--tests/lang/operators/operator_lt_basic.phpt62
-rw-r--r--tests/lang/operators/operator_lt_or_equal_basic.phpt64
-rw-r--r--tests/lang/operators/operator_lt_or_equal_variation.phpt63
-rw-r--r--tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt63
-rw-r--r--tests/lang/operators/operator_lt_variation.phpt60
-rw-r--r--tests/lang/operators/operator_lt_variation_64bit.phpt60
-rw-r--r--tests/lang/operators/operator_notequals_basic.phpt65
-rw-r--r--tests/lang/operators/operator_notequals_variation.phpt63
-rw-r--r--tests/lang/operators/operator_notequals_variation_64bit.phpt65
-rw-r--r--tests/lang/operators/operator_notidentical_basic.phpt65
-rw-r--r--tests/lang/operators/operator_notidentical_variation.phpt64
-rw-r--r--tests/lang/operators/operator_notidentical_variation_64bit.phpt65
-rw-r--r--tests/lang/operators/postdec_basiclong_64bit.phpt61
-rw-r--r--tests/lang/operators/postdec_variationStr.phpt49
-rw-r--r--tests/lang/operators/postinc_basiclong_64bit.phpt61
-rw-r--r--tests/lang/operators/postinc_variationStr.phpt49
-rw-r--r--tests/lang/operators/predec_basiclong_64bit.phpt60
-rw-r--r--tests/lang/operators/predec_variationStr.phpt48
-rw-r--r--tests/lang/operators/preinc_basiclong_64bit.phpt60
-rw-r--r--tests/lang/operators/preinc_variationStr.phpt48
-rw-r--r--tests/lang/operators/subtract_basiclong_64bit.phpt582
-rw-r--r--tests/lang/operators/subtract_variationStr.phpt416
-rw-r--r--tests/lang/passByReference_001.phpt37
-rw-r--r--tests/lang/passByReference_002.phpt15
-rw-r--r--tests/lang/passByReference_003.phpt48
-rw-r--r--tests/lang/passByReference_004.phpt21
-rw-r--r--tests/lang/passByReference_005.phpt261
-rw-r--r--tests/lang/passByReference_006.phpt195
-rw-r--r--tests/lang/passByReference_007.phpt105
-rw-r--r--tests/lang/passByReference_008.phpt40
-rw-r--r--tests/lang/passByReference_009.phpt24
-rw-r--r--tests/lang/passByReference_010.phpt61
-rw-r--r--tests/lang/passByReference_012.phpt25
-rw-r--r--tests/lang/returnByReference.001.phpt20
-rw-r--r--tests/lang/returnByReference.002.phpt29
-rw-r--r--tests/lang/returnByReference.003.phpt55
-rw-r--r--tests/lang/returnByReference.004.phpt57
-rw-r--r--tests/lang/returnByReference.005.phpt58
-rw-r--r--tests/lang/returnByReference.006.phpt60
-rw-r--r--tests/lang/returnByReference.007.phpt63
-rw-r--r--tests/lang/returnByReference.008.phpt64
-rw-r--r--tests/lang/returnByReference.009.phpt39
-rw-r--r--tests/lang/script_tag.phpt17
-rw-r--r--tests/lang/short_tags.001.phpt12
-rw-r--r--tests/lang/short_tags.002.phpt14
-rw-r--r--tests/lang/short_tags.003.phpt32
-rw-r--r--tests/lang/short_tags.004.phpt35
-rw-r--r--tests/lang/static_basic_001.phpt84
-rw-r--r--tests/lang/static_basic_002.phpt28
-rw-r--r--tests/lang/static_variation_001.phpt112
-rw-r--r--tests/lang/static_variation_002.phpt84
-rw-r--r--tests/lang/string_decimals_001.phpt45
-rw-r--r--tests/lang/this_assignment.phpt43
-rw-r--r--tests/lang/throw_variation_001.phpt14
-rw-r--r--tests/lang/type_hints_001.phpt26
-rw-r--r--tests/lang/type_hints_002.phpt28
-rw-r--r--tests/lang/type_hints_003.phpt14
-rw-r--r--tests/output/bug46897.phpt27
-rw-r--r--tests/output/bug60282.phpt12
-rw-r--r--tests/output/bug60321.phpt9
-rw-r--r--tests/output/bug60322.phpt8
-rw-r--r--tests/output/bug60768.phpt25
-rw-r--r--tests/output/flush_basic_001.phpt26
-rw-r--r--tests/output/flush_error_001.phpt16
-rw-r--r--tests/output/ob_001.phpt8
-rw-r--r--tests/output/ob_002.phpt9
-rw-r--r--tests/output/ob_003.phpt13
-rw-r--r--tests/output/ob_004.phpt11
-rw-r--r--tests/output/ob_005.phpt14
-rw-r--r--tests/output/ob_006.phpt12
-rw-r--r--tests/output/ob_007.phpt11
-rw-r--r--tests/output/ob_008.phpt11
-rw-r--r--tests/output/ob_009.phpt12
-rw-r--r--tests/output/ob_010.phpt13
-rw-r--r--tests/output/ob_011.phpt13
-rw-r--r--tests/output/ob_012.phpt22
-rw-r--r--tests/output/ob_013.phpt105
-rw-r--r--tests/output/ob_014.phpt22
-rw-r--r--tests/output/ob_015.phpt22
-rw-r--r--tests/output/ob_017.phpt34
-rw-r--r--tests/output/ob_018.phpt17
-rw-r--r--tests/output/ob_020.phpt38
-rw-r--r--tests/output/ob_clean_basic_001.phpt36
-rw-r--r--tests/output/ob_clean_error_001.phpt27
-rw-r--r--tests/output/ob_end_clean_basic_001.phpt31
-rw-r--r--tests/output/ob_end_clean_error_001.phpt22
-rw-r--r--tests/output/ob_end_flush_basic_001.phpt41
-rw-r--r--tests/output/ob_end_flush_error_001.phpt27
-rw-r--r--tests/output/ob_flush_basic_001.phpt39
-rw-r--r--tests/output/ob_flush_error_001.phpt27
-rw-r--r--tests/output/ob_get_clean_basic_001.phpt18
-rw-r--r--tests/output/ob_get_clean_basic_002.phpt20
-rw-r--r--tests/output/ob_get_clean_error_001.phpt22
-rw-r--r--tests/output/ob_get_contents_basic_001.phpt73
-rw-r--r--tests/output/ob_get_contents_error_001.phpt32
-rw-r--r--tests/output/ob_get_length_basic_001.phpt37
-rw-r--r--tests/output/ob_get_length_error_001.phpt22
-rw-r--r--tests/output/ob_get_level_basic_001.phpt47
-rw-r--r--tests/output/ob_get_level_error_001.phpt27
-rw-r--r--tests/output/ob_get_status.phpt33
-rw-r--r--tests/output/ob_implicit_flush_basic_001.phpt24
-rw-r--r--tests/output/ob_implicit_flush_basic_002.phpt29
-rw-r--r--tests/output/ob_implicit_flush_error_001.phpt29
-rw-r--r--tests/output/ob_implicit_flush_variation_001.phpt192
-rw-r--r--tests/output/ob_start_basic_001.phpt14
-rw-r--r--tests/output/ob_start_basic_002.phpt55
-rw-r--r--tests/output/ob_start_basic_003.phpt18
-rw-r--r--tests/output/ob_start_basic_004.phpt132
-rw-r--r--tests/output/ob_start_basic_005.phpt33
-rw-r--r--tests/output/ob_start_basic_006.phpt135
-rw-r--r--tests/output/ob_start_basic_unerasable_001.phpt22
-rw-r--r--tests/output/ob_start_basic_unerasable_002.phpt33
-rw-r--r--tests/output/ob_start_basic_unerasable_003.phpt22
-rw-r--r--tests/output/ob_start_basic_unerasable_004.phpt22
-rw-r--r--tests/output/ob_start_basic_unerasable_005.phpt25
-rw-r--r--tests/output/ob_start_callbacks.phpt39
-rw-r--r--tests/output/ob_start_error_001.phpt53
-rw-r--r--tests/output/ob_start_error_002.phpt42
-rw-r--r--tests/output/ob_start_error_003.phpt22
-rw-r--r--tests/output/ob_start_error_004.phpt22
-rw-r--r--tests/output/ob_start_error_005.phpt23
-rw-r--r--tests/quicktester.inc75
-rw-r--r--tests/run-test/test001.phpt6
-rw-r--r--tests/run-test/test002.phpt18
-rw-r--r--tests/run-test/test003.phpt6
-rw-r--r--tests/run-test/test004.phpt10
-rw-r--r--tests/run-test/test005.phpt32
-rw-r--r--tests/run-test/test006.phpt9
-rw-r--r--tests/run-test/test007.phptbin0 -> 1191 bytes
-rw-r--r--tests/run-test/test008.phpt33
-rw-r--r--tests/run-test/test008a.phpt32
-rw-r--r--tests/run-test/test009.phpt12
-rw-r--r--tests/run-test/test010.phpt17
-rw-r--r--tests/security/bug53226.phpt29
-rw-r--r--tests/security/open_basedir.inc139
-rw-r--r--tests/security/open_basedir_001.phpt25
-rw-r--r--tests/security/open_basedir_chdir.phpt50
-rw-r--r--tests/security/open_basedir_chmod.phpt72
-rw-r--r--tests/security/open_basedir_copy.phpt78
-rw-r--r--tests/security/open_basedir_copy_variation1.phpt34
-rw-r--r--tests/security/open_basedir_dir.phpt89
-rw-r--r--tests/security/open_basedir_disk_free_space.phpt52
-rw-r--r--tests/security/open_basedir_error_log.phpt45
-rw-r--r--tests/security/open_basedir_error_log_variation.phpt49
-rw-r--r--tests/security/open_basedir_file.phpt88
-rw-r--r--tests/security/open_basedir_file_exists.phpt55
-rw-r--r--tests/security/open_basedir_file_get_contents.phpt75
-rw-r--r--tests/security/open_basedir_file_put_contents.phpt57
-rw-r--r--tests/security/open_basedir_fileatime.phpt55
-rw-r--r--tests/security/open_basedir_filectime.phpt55
-rw-r--r--tests/security/open_basedir_filegroup.phpt55
-rw-r--r--tests/security/open_basedir_fileinode.phpt55
-rw-r--r--tests/security/open_basedir_filemtime.phpt55
-rw-r--r--tests/security/open_basedir_fileowner.phpt55
-rw-r--r--tests/security/open_basedir_fileperms.phpt55
-rw-r--r--tests/security/open_basedir_filesize.phpt55
-rw-r--r--tests/security/open_basedir_filetype.phpt55
-rw-r--r--tests/security/open_basedir_fopen.phpt86
-rw-r--r--tests/security/open_basedir_glob.phpt52
-rw-r--r--tests/security/open_basedir_glob_variation.phpt26
-rw-r--r--tests/security/open_basedir_is_dir.phpt55
-rw-r--r--tests/security/open_basedir_is_executable.phpt59
-rw-r--r--tests/security/open_basedir_is_file.phpt55
-rw-r--r--tests/security/open_basedir_is_link.phpt55
-rw-r--r--tests/security/open_basedir_is_readable.phpt55
-rw-r--r--tests/security/open_basedir_is_writable.phpt55
-rw-r--r--tests/security/open_basedir_link.phpt78
-rw-r--r--tests/security/open_basedir_linkinfo.phpt65
-rw-r--r--tests/security/open_basedir_lstat.phpt55
-rw-r--r--tests/security/open_basedir_mkdir.phpt52
-rw-r--r--tests/security/open_basedir_opendir.phpt73
-rw-r--r--tests/security/open_basedir_parse_ini_file.phpt75
-rw-r--r--tests/security/open_basedir_readlink.phpt72
-rw-r--r--tests/security/open_basedir_realpath.phpt61
-rw-r--r--tests/security/open_basedir_rename.phpt47
-rw-r--r--tests/security/open_basedir_rmdir.phpt47
-rw-r--r--tests/security/open_basedir_scandir.phpt110
-rw-r--r--tests/security/open_basedir_stat.phpt55
-rw-r--r--tests/security/open_basedir_symlink.phpt87
-rw-r--r--tests/security/open_basedir_tempnam.phpt75
-rw-r--r--tests/security/open_basedir_touch.phpt70
-rw-r--r--tests/security/open_basedir_unlink.phpt47
-rw-r--r--tests/strings/001.phpt210
-rw-r--r--tests/strings/002.phpt83
-rw-r--r--tests/strings/004.phpt21
-rw-r--r--tests/strings/bug22592.phpt27
-rw-r--r--tests/strings/bug26703.phpt17
-rw-r--r--tests/strings/offsets_chaining_1.phpt12
-rw-r--r--tests/strings/offsets_chaining_2.phpt12
-rw-r--r--tests/strings/offsets_chaining_3.phpt12
-rw-r--r--tests/strings/offsets_chaining_4.phpt12
-rw-r--r--tests/strings/offsets_chaining_5.phpt27
-rw-r--r--tests/strings/offsets_general.phpt38
779 files changed, 57019 insertions, 0 deletions
diff --git a/tests/basic/001.phpt b/tests/basic/001.phpt
new file mode 100644
index 0000000..d0cc1ca
--- /dev/null
+++ b/tests/basic/001.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Trivial "Hello World" test
+--FILE--
+<?php echo "Hello World"?>
+--EXPECT--
+Hello World
diff --git a/tests/basic/002.phpt b/tests/basic/002.phpt
new file mode 100644
index 0000000..25dc513
--- /dev/null
+++ b/tests/basic/002.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Simple POST Method test
+--POST--
+a=Hello+World
+--FILE--
+<?php
+echo $_POST['a']; ?>
+--EXPECT--
+Hello World
diff --git a/tests/basic/003.phpt b/tests/basic/003.phpt
new file mode 100644
index 0000000..43d3be1
--- /dev/null
+++ b/tests/basic/003.phpt
@@ -0,0 +1,12 @@
+--TEST--
+GET and POST Method combined
+--POST--
+a=Hello+World
+--GET--
+b=Hello+Again+World&c=Hi+Mom
+--FILE--
+<?php
+error_reporting(0);
+echo "post-a=({$_POST['a']}) get-b=({$_GET['b']}) get-c=({$_GET['c']})"?>
+--EXPECT--
+post-a=(Hello World) get-b=(Hello Again World) get-c=(Hi Mom)
diff --git a/tests/basic/004.phpt b/tests/basic/004.phpt
new file mode 100644
index 0000000..c381e50
--- /dev/null
+++ b/tests/basic/004.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Two variables in POST data
+--POST--
+a=Hello+World&b=Hello+Again+World
+--FILE--
+<?php
+error_reporting(0);
+echo "{$_POST['a']} {$_POST['b']}" ?>
+--EXPECT--
+Hello World Hello Again World
diff --git a/tests/basic/005.phpt b/tests/basic/005.phpt
new file mode 100644
index 0000000..742e0ca
--- /dev/null
+++ b/tests/basic/005.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Three variables in POST data
+--POST--
+a=Hello+World&b=Hello+Again+World&c=1
+--FILE--
+<?php
+error_reporting(0);
+echo "{$_POST['a']} {$_POST['b']} {$_POST['c']}"?>
+--EXPECT--
+Hello World Hello Again World 1
diff --git a/tests/basic/006.phpt b/tests/basic/006.phpt
new file mode 100644
index 0000000..c614cd9
--- /dev/null
+++ b/tests/basic/006.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Add 3 variables together and print result
+--FILE--
+<?php $a=1; $b=2; $c=3; $d=$a+$b+$c; echo $d?>
+--EXPECT--
+6
diff --git a/tests/basic/007.phpt b/tests/basic/007.phpt
new file mode 100644
index 0000000..dc808b7
--- /dev/null
+++ b/tests/basic/007.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Multiply 3 variables and print result
+--FILE--
+<?php $a=2; $b=4; $c=8; $d=$a*$b*$c; echo $d?>
+--EXPECT--
+64
diff --git a/tests/basic/008.phpt b/tests/basic/008.phpt
new file mode 100644
index 0000000..511aef0
--- /dev/null
+++ b/tests/basic/008.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Divide 3 variables and print result
+--FILE--
+<?php $a=27; $b=3; $c=3; $d=$a/$b/$c; echo $d?>
+--EXPECT--
+3
diff --git a/tests/basic/009.phpt b/tests/basic/009.phpt
new file mode 100644
index 0000000..fefe529
--- /dev/null
+++ b/tests/basic/009.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Subtract 3 variables and print result
+--FILE--
+<?php $a=27; $b=7; $c=10; $d=$a-$b-$c; echo $d?>
+--EXPECT--
+10
diff --git a/tests/basic/010.phpt b/tests/basic/010.phpt
new file mode 100644
index 0000000..9cdfece
--- /dev/null
+++ b/tests/basic/010.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Testing | and & operators
+--FILE--
+<?php $a=8; $b=4; $c=8; echo $a|$b&$c?>
+--EXPECT--
+8
diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt
new file mode 100644
index 0000000..7925674
--- /dev/null
+++ b/tests/basic/011.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Testing $argc and $argv handling (GET)
+--INI--
+register_argc_argv=1
+--GET--
+ab+cd+ef+123+test
+--FILE--
+<?php
+$argc = $_SERVER['argc'];
+$argv = $_SERVER['argv'];
+
+for ($i=0; $i<$argc; $i++) {
+ echo "$i: ".$argv[$i]."\n";
+}
+
+?>
+--EXPECT--
+0: ab
+1: cd
+2: ef
+3: 123
+4: test
diff --git a/tests/basic/012.phpt b/tests/basic/012.phpt
new file mode 100644
index 0000000..5c10c7c
--- /dev/null
+++ b/tests/basic/012.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Testing $argc and $argv handling (cli)
+--SKIPIF--
+<?php if(php_sapi_name()!='cli') echo 'skip'; ?>
+--INI--
+register_argc_argv=1
+variables_order=GPS
+--ARGS--
+ab cd ef 123 test
+--FILE--
+<?php
+$argc = $_SERVER['argc'];
+$argv = $_SERVER['argv'];
+
+for ($i=1; $i<$argc; $i++) {
+ echo ($i-1).": ".$argv[$i]."\n";
+}
+
+?>
+--EXPECT--
+0: ab
+1: cd
+2: ef
+3: 123
+4: test
diff --git a/tests/basic/013.phpt b/tests/basic/013.phpt
new file mode 100644
index 0000000..376cc06
--- /dev/null
+++ b/tests/basic/013.phpt
@@ -0,0 +1,13 @@
+--TEST--
+POST Method test and arrays
+--POST--
+a[]=1
+--FILE--
+<?php
+var_dump($_POST['a']);
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(1) "1"
+}
diff --git a/tests/basic/014.phpt b/tests/basic/014.phpt
new file mode 100644
index 0000000..7288c44
--- /dev/null
+++ b/tests/basic/014.phpt
@@ -0,0 +1,15 @@
+--TEST--
+POST Method test and arrays - 2
+--POST--
+a[]=1&a[]=1
+--FILE--
+<?php
+var_dump($_POST['a']);
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "1"
+}
diff --git a/tests/basic/015.phpt b/tests/basic/015.phpt
new file mode 100644
index 0000000..eecbaf1
--- /dev/null
+++ b/tests/basic/015.phpt
@@ -0,0 +1,13 @@
+--TEST--
+POST Method test and arrays - 3
+--POST--
+a[]=1&a[0]=5
+--FILE--
+<?php
+var_dump($_POST['a']);
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(1) "5"
+}
diff --git a/tests/basic/016.phpt b/tests/basic/016.phpt
new file mode 100644
index 0000000..b34fd1b
--- /dev/null
+++ b/tests/basic/016.phpt
@@ -0,0 +1,15 @@
+--TEST--
+POST Method test and arrays - 4
+--POST--
+a[a]=1&a[b]=3
+--FILE--
+<?php
+var_dump($_POST['a']);
+?>
+--EXPECT--
+array(2) {
+ ["a"]=>
+ string(1) "1"
+ ["b"]=>
+ string(1) "3"
+}
diff --git a/tests/basic/017.phpt b/tests/basic/017.phpt
new file mode 100644
index 0000000..d514726
--- /dev/null
+++ b/tests/basic/017.phpt
@@ -0,0 +1,17 @@
+--TEST--
+POST Method test and arrays - 5
+--POST--
+a[]=1&a[a]=1&a[b]=3
+--FILE--
+<?php
+var_dump($_POST['a']);
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ string(1) "1"
+ ["a"]=>
+ string(1) "1"
+ ["b"]=>
+ string(1) "3"
+}
diff --git a/tests/basic/018.phpt b/tests/basic/018.phpt
new file mode 100644
index 0000000..45996b2
--- /dev/null
+++ b/tests/basic/018.phpt
@@ -0,0 +1,34 @@
+--TEST--
+POST Method test and arrays - 6
+--POST--
+a[][]=1&a[][]=3&b[a][b][c]=1&b[a][b][d]=1
+--FILE--
+<?php
+var_dump($_POST['a']);
+var_dump($_POST['b']);
+?>
+--EXPECT--
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "1"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(1) "3"
+ }
+}
+array(1) {
+ ["a"]=>
+ array(1) {
+ ["b"]=>
+ array(2) {
+ ["c"]=>
+ string(1) "1"
+ ["d"]=>
+ string(1) "1"
+ }
+ }
+}
diff --git a/tests/basic/019.phpt b/tests/basic/019.phpt
new file mode 100644
index 0000000..3bece24
--- /dev/null
+++ b/tests/basic/019.phpt
@@ -0,0 +1,17 @@
+--TEST--
+POST Method test and arrays - 7
+--POST--
+a[]=1&a[]]=3&a[[]=4
+--FILE--
+<?php
+var_dump($_POST['a']);
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "3"
+ ["["]=>
+ string(1) "4"
+}
diff --git a/tests/basic/020.phpt b/tests/basic/020.phpt
new file mode 100644
index 0000000..c94a604
--- /dev/null
+++ b/tests/basic/020.phpt
@@ -0,0 +1,15 @@
+--TEST--
+POST Method test and arrays - 8
+--POST--
+a[a[]]=1&a[b[]]=3
+--FILE--
+<?php
+var_dump($_POST['a']);
+?>
+--EXPECT--
+array(2) {
+ ["a["]=>
+ string(1) "1"
+ ["b["]=>
+ string(1) "3"
+}
diff --git a/tests/basic/021.phpt b/tests/basic/021.phpt
new file mode 100644
index 0000000..eeaf588
--- /dev/null
+++ b/tests/basic/021.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #37276 (problems witch $_POST array)
+--INI--
+file_uploads=1
+upload_tmp_dir=.
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="submitter"
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="pics"; filename="bug37276.txt"
+Content-Type: text/plain
+
+bug37276
+
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(1) {
+ ["pics"]=>
+ array(5) {
+ ["name"]=>
+ string(12) "bug37276.txt"
+ ["type"]=>
+ string(10) "text/plain"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(9)
+ }
+}
+array(1) {
+ ["submitter"]=>
+ string(8) "testname"
+}
diff --git a/tests/basic/022.phpt b/tests/basic/022.phpt
new file mode 100644
index 0000000..0ab70d4
--- /dev/null
+++ b/tests/basic/022.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Cookies test#1
+--INI--
+max_input_vars=1000
+filter.default=unsafe_raw
+--COOKIE--
+cookie1=val1 ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1=bogus; %20cookie1=ignore;+cookie1=ignore;cookie1;cookie 5=%20 value; cookie%206=þæö;cookie+7=;$cookie.8;cookie-9=1;;;- & % $cookie 10=10
+--FILE--
+<?php
+var_dump($_COOKIE);
+?>
+--EXPECT--
+array(10) {
+ ["cookie1"]=>
+ string(6) "val1 "
+ ["cookie2"]=>
+ string(5) "val2 "
+ ["cookie3"]=>
+ string(6) "val 3."
+ ["cookie_4"]=>
+ string(10) " value 4 ;"
+ ["cookie__5"]=>
+ string(7) " value"
+ ["cookie_6"]=>
+ string(3) "þæö"
+ ["cookie_7"]=>
+ string(0) ""
+ ["$cookie_8"]=>
+ string(0) ""
+ ["cookie-9"]=>
+ string(1) "1"
+ ["-_&_%_$cookie_10"]=>
+ string(2) "10"
+}
diff --git a/tests/basic/023.phpt b/tests/basic/023.phpt
new file mode 100644
index 0000000..ca5f1dc
--- /dev/null
+++ b/tests/basic/023.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Cookies test#2
+--INI--
+max_input_vars=1000
+filter.default=unsafe_raw
+--COOKIE--
+c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name="value","value",UEhQIQ==;UEhQIQ==foo
+--FILE--
+<?php
+var_dump($_COOKIE);
+?>
+--EXPECT--
+array(3) {
+ ["c_o_o_k_i_e"]=>
+ string(5) "value"
+ ["name"]=>
+ string(24) ""value","value",UEhQIQ=="
+ ["UEhQIQ"]=>
+ string(4) "=foo"
+}
diff --git a/tests/basic/024.phpt b/tests/basic/024.phpt
new file mode 100644
index 0000000..bf8a206
--- /dev/null
+++ b/tests/basic/024.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Test HTTP_RAW_POST_DATA creation
+--INI--
+always_populate_raw_post_data=1
+max_input_vars=1000
+--POST--
+a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3
+--FILE--
+<?php
+var_dump($_POST, $HTTP_RAW_POST_DATA);
+?>
+--EXPECT--
+array(3) {
+ ["a"]=>
+ string(3) "ABC"
+ ["y"]=>
+ string(3) "XYZ"
+ ["c"]=>
+ array(3) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+ ["a"]=>
+ string(1) "3"
+ }
+}
+string(30) "a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3"
diff --git a/tests/basic/025.phpt b/tests/basic/025.phpt
new file mode 100644
index 0000000..58191bc
--- /dev/null
+++ b/tests/basic/025.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Test HTTP_RAW_POST_DATA with excessive post length
+--INI--
+always_populate_raw_post_data=1
+post_max_size=1K
+--POST--
+a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+--FILE--
+<?php
+var_dump($_POST, $HTTP_RAW_POST_DATA);
+?>
+--EXPECTF--
+Warning: Unknown: POST Content-Length of 2050 bytes exceeds the limit of 1024 bytes in Unknown on line 0
+
+Warning: Cannot modify header information - headers already sent in Unknown on line 0
+
+Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+array(0) {
+}
+NULL
diff --git a/tests/basic/026.phpt b/tests/basic/026.phpt
new file mode 100644
index 0000000..b98a31f
--- /dev/null
+++ b/tests/basic/026.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Registration of HTTP_RAW_POST_DATA due to unknown content-type
+--INI--
+always_populate_raw_post_data=0
+--POST_RAW--
+Content-Type: unknown/type
+a=1&b=ZYX
+--FILE--
+<?php
+var_dump($_POST, $HTTP_RAW_POST_DATA);
+?>
+--EXPECT--
+array(0) {
+}
+string(9) "a=1&b=ZYX"
diff --git a/tests/basic/027.phpt b/tests/basic/027.phpt
new file mode 100644
index 0000000..0528e83
--- /dev/null
+++ b/tests/basic/027.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Handling of max_input_nesting_level being reached
+--INI--
+always_populate_raw_post_data=0
+display_errors=0
+max_input_nesting_level=10
+max_input_vars=1000
+track_errors=1
+log_errors=0
+--POST--
+a=1&b=ZYX&c[][][][][][][][][][][][][][][][][][][][][][]=123&d=123&e[][]][]=3
+--FILE--
+<?php
+var_dump($_POST, $php_errormsg);
+?>
+--EXPECT--
+array(4) {
+ ["a"]=>
+ string(1) "1"
+ ["b"]=>
+ string(3) "ZYX"
+ ["d"]=>
+ string(3) "123"
+ ["e"]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(1) "3"
+ }
+ }
+}
+string(115) "Unknown: Input variable nesting level exceeded 10. To increase the limit change max_input_nesting_level in php.ini."
diff --git a/tests/basic/028.phpt b/tests/basic/028.phpt
new file mode 100644
index 0000000..37d6f21
--- /dev/null
+++ b/tests/basic/028.phpt
@@ -0,0 +1,105 @@
+--TEST--
+RFC1867 character quotting
+--INI--
+file_uploads=1
+max_input_vars=1000
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name=name1
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name='name2'
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="name3"
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name=name\4
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name=name\\5
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name=name\'6
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name=name\"7
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name='name\8'
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name='name\\9'
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name='name\'10'
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name='name\"11'
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="name\12"
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="name\\13"
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="name\'14"
+
+testname
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="name\"15"
+
+testname
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(15) {
+ ["name1"]=>
+ string(8) "testname"
+ ["name2"]=>
+ string(8) "testname"
+ ["name3"]=>
+ string(8) "testname"
+ ["name\4"]=>
+ string(8) "testname"
+ ["name\5"]=>
+ string(8) "testname"
+ ["name\'6"]=>
+ string(8) "testname"
+ ["name\"7"]=>
+ string(8) "testname"
+ ["name\8"]=>
+ string(8) "testname"
+ ["name\9"]=>
+ string(8) "testname"
+ ["name'10"]=>
+ string(8) "testname"
+ ["name\"11"]=>
+ string(8) "testname"
+ ["name\12"]=>
+ string(8) "testname"
+ ["name\13"]=>
+ string(8) "testname"
+ ["name\'14"]=>
+ string(8) "testname"
+ ["name"15"]=>
+ string(8) "testname"
+}
diff --git a/tests/basic/029.phpt b/tests/basic/029.phpt
new file mode 100644
index 0000000..6d95c07
--- /dev/null
+++ b/tests/basic/029.phpt
@@ -0,0 +1,51 @@
+--TEST--
+Shift_JIS request
+--SKIPIF--
+<?php
+if (!extension_loaded("mbstring")) {
+ die("skip Requires mbstring extension");
+}
+?>
+--INI--
+file_uploads=1
+mbstring.encoding_translation=1
+mbstring.http_input=Shift_JIS
+mbstring.internal_encoding=UTF-8
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="—\Ž\”\"
+
+ƒhƒŒƒ~ƒtƒ@ƒ\
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="pics"; filename="file1.txt"
+Content-Type: text/plain
+
+file1
+
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(1) {
+ ["pics"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file1.txt"
+ ["type"]=>
+ string(10) "text/plain"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(6)
+ }
+}
+array(1) {
+ ["予蚕胜"]=>
+ string(18) "ドレミファ゜"
+}
diff --git a/tests/basic/030.phpt b/tests/basic/030.phpt
new file mode 100644
index 0000000..cf2a270
--- /dev/null
+++ b/tests/basic/030.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug#55504 (Content-Type header is not parsed correctly on HTTP POST request)
+--INI--
+file_uploads=1
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=BVoyv; charset=iso-8859-1
+--BVoyv
+Content-Disposition: form-data; name="data"
+
+abc
+--BVoyv--
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(1) {
+ ["data"]=>
+ string(3) "abc"
+}
diff --git a/tests/basic/031.phpt b/tests/basic/031.phpt
new file mode 100644
index 0000000..12b8354
--- /dev/null
+++ b/tests/basic/031.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug#55504 (Content-Type header is not parsed correctly on HTTP POST request)
+--INI--
+file_uploads=1
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=BVoyv; charset=iso-8859-1
+--BVoyv
+Content-Disposition: form-data; name="data"
+
+abc
+--BVoyv
+Content-Disposition: form-data; name="data2"
+
+more data
+--BVoyv
+Content-Disposition: form-data; name="data3"
+
+even more data
+--BVoyv--
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(3) {
+ ["data"]=>
+ string(3) "abc"
+ ["data2"]=>
+ string(9) "more data"
+ ["data3"]=>
+ string(14) "even more data"
+}
diff --git a/tests/basic/032.phpt b/tests/basic/032.phpt
new file mode 100644
index 0000000..a6aba5b
--- /dev/null
+++ b/tests/basic/032.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug#18792 (no form variables after multipart/form-data)
+--INI--
+file_uploads=1
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=BVoyv, charset=iso-8859-1
+--BVoyv
+Content-Disposition: form-data; name="data"
+
+abc
+--BVoyv--
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(1) {
+ ["data"]=>
+ string(3) "abc"
+}
diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt
new file mode 100644
index 0000000..1406ce0
--- /dev/null
+++ b/tests/basic/bug20539.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #20539 (PHP CLI Segmentation Fault)
+--SKIPIF--
+<?php if (!extension_loaded("session")) die("skip session extension not available"); ?>
+<?php unlink(__DIR__. '/sess_' .session_id()); ?>
+--INI--
+session.auto_start=1
+session.save_handler=files
+session.save_path=./tests/basic/
+--FILE--
+<?php
+ print "good :)\n";
+ $filename = __DIR__ . '/sess_' . session_id();
+ var_dump(file_exists($filename));
+ @unlink($filename);
+?>
+--EXPECT--
+good :)
+bool(true)
+
diff --git a/tests/basic/bug29971.phpt b/tests/basic/bug29971.phpt
new file mode 100644
index 0000000..d4b654b
--- /dev/null
+++ b/tests/basic/bug29971.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #29971 (variables_order behaviour)
+--INI--
+variables_order=GPC
+--FILE--
+<?php
+var_dump($_ENV,$_SERVER);
+var_dump(ini_get("variables_order"));
+?>
+--EXPECT--
+array(0) {
+}
+array(0) {
+}
+string(3) "GPC"
diff --git a/tests/basic/bug45986.phpt b/tests/basic/bug45986.phpt
new file mode 100644
index 0000000..1c30f10
--- /dev/null
+++ b/tests/basic/bug45986.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #45986 (wrong error message for a non existant file on rename)
+--CREDITS--
+Sebastian SchÃŒrmann
+sebs@php.net
+Testfest 2009 Munich
+--FILE--
+<?php
+rename('foo', 'bar');
+?>
+--EXPECTF--
+Warning: %s in %sbug45986.php on line 2
diff --git a/tests/basic/bug51709_1.phpt b/tests/basic/bug51709_1.phpt
new file mode 100644
index 0000000..3f2d544
--- /dev/null
+++ b/tests/basic/bug51709_1.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #51709 (Can't use keywords as method names)
+--FILE--
+<?php
+
+class foo {
+ static function for() {
+ echo "1";
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Parse error: syntax error, unexpected %s, expecting %s in %sbug51709_1.php on line %d
diff --git a/tests/basic/bug51709_2.phpt b/tests/basic/bug51709_2.phpt
new file mode 100644
index 0000000..bb1f91c
--- /dev/null
+++ b/tests/basic/bug51709_2.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #51709 (Can't use keywords as method names)
+--FILE--
+<?php
+
+class foo {
+ static function goto() {
+ echo "1";
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Parse error: syntax error, unexpected %s, expecting %s in %sbug51709_2.php on line %d
diff --git a/tests/basic/bug53180.phpt b/tests/basic/bug53180.phpt
new file mode 100644
index 0000000..5c2eb76
--- /dev/null
+++ b/tests/basic/bug53180.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #53180 (post_max_size=0 partly not working)
+--INI--
+post_max_size=0
+--POST--
+email=foo&password=bar&submit=Log+on
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(3) {
+ ["email"]=>
+ string(3) "foo"
+ ["password"]=>
+ string(3) "bar"
+ ["submit"]=>
+ string(6) "Log on"
+}
diff --git a/tests/basic/bug54514.phpt b/tests/basic/bug54514.phpt
new file mode 100644
index 0000000..0c5595e
--- /dev/null
+++ b/tests/basic/bug54514.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Req #54514 (Get php binary path during script execution)
+--FILE--
+<?php
+if(realpath(getenv('TEST_PHP_EXECUTABLE')) === realpath(PHP_BINARY)) {
+ echo "done";
+} else {
+ var_dump(getenv('TEST_PHP_EXECUTABLE'));
+ var_dump(PHP_BINARY);
+}
+--EXPECT--
+done
diff --git a/tests/basic/bug55500.phpt b/tests/basic/bug55500.phpt
new file mode 100644
index 0000000..97eeea2
--- /dev/null
+++ b/tests/basic/bug55500.phpt
@@ -0,0 +1,68 @@
+--TEST--
+Bug #55500 (Corrupted $_FILES indices lead to security concern)
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+upload_max_filesize=1024
+max_file_uploads=10
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file[]"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file[[type]"; filename="file2.txt"
+Content-Type: text/plain-file2
+
+2
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file[[name]"; filename="file3.txt"
+Content-Type: text/plain-file3
+
+3
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file[name]["; filename="file4.txt"
+Content-Type: text/plain-file3
+
+4
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(1) {
+ [%u|b%"file"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ array(1) {
+ [0]=>
+ %unicode|string%(9) "file1.txt"
+ }
+ [%u|b%"type"]=>
+ array(1) {
+ [0]=>
+ %unicode|string%(16) "text/plain-file1"
+ }
+ [%u|b%"tmp_name"]=>
+ array(1) {
+ [0]=>
+ %unicode|string%(%d) "%s"
+ }
+ [%u|b%"error"]=>
+ array(1) {
+ [0]=>
+ int(0)
+ }
+ [%u|b%"size"]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+ }
+}
+array(0) {
+}
diff --git a/tests/basic/bug61000.phpt b/tests/basic/bug61000.phpt
new file mode 100644
index 0000000..8149d68
--- /dev/null
+++ b/tests/basic/bug61000.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #61000 (Exceeding max nesting level doesn't delete numerical vars)
+--INI--
+max_input_nesting_level=2
+--POST--
+1[a][]=foo&1[a][b][c]=bar
+--GET--
+a[a][]=foo&a[a][b][c]=bar
+--FILE--
+<?php
+print_r($_GET);
+print_r($_POST);
+--EXPECTF--
+Array
+(
+)
+Array
+(
+)
diff --git a/tests/basic/enable_post_data_reading_01.phpt b/tests/basic/enable_post_data_reading_01.phpt
new file mode 100644
index 0000000..1a0e33f
--- /dev/null
+++ b/tests/basic/enable_post_data_reading_01.phpt
@@ -0,0 +1,22 @@
+--TEST--
+enable_post_data_reading: basic test
+--INI--
+enable_post_data_reading=0
+--POST_RAW--
+Content-Type: application/x-www-form-urlencoded
+a=1&b=ZYX
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+var_dump($HTTP_RAW_POST_DATA);
+var_dump(file_get_contents("php://input"));
+--EXPECTF--
+array(0) {
+}
+array(0) {
+}
+
+Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+NULL
+string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_02.phpt b/tests/basic/enable_post_data_reading_02.phpt
new file mode 100644
index 0000000..dc7f6b1
--- /dev/null
+++ b/tests/basic/enable_post_data_reading_02.phpt
@@ -0,0 +1,28 @@
+--TEST--
+enable_post_data_reading: rfc1867
+--INI--
+enable_post_data_reading=0
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+var_dump(file_get_contents("php://input"));
+--EXPECTF--
+array(0) {
+}
+array(0) {
+}
+string(%d) "-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file
+
+1
+-----------------------------20896060251896012921717172737--"
diff --git a/tests/basic/enable_post_data_reading_03.phpt b/tests/basic/enable_post_data_reading_03.phpt
new file mode 100644
index 0000000..cdabe91
--- /dev/null
+++ b/tests/basic/enable_post_data_reading_03.phpt
@@ -0,0 +1,23 @@
+--TEST--
+enable_post_data_reading: always_populate_raw_post_data has no effect (1)
+--INI--
+enable_post_data_reading=0
+always_populate_raw_post_data=1
+--POST_RAW--
+Content-Type: application/x-www-form-urlencoded
+a=1&b=ZYX
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+var_dump($HTTP_RAW_POST_DATA);
+var_dump(file_get_contents("php://input"));
+--EXPECTF--
+array(0) {
+}
+array(0) {
+}
+
+Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+NULL
+string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_04.phpt b/tests/basic/enable_post_data_reading_04.phpt
new file mode 100644
index 0000000..a168504
--- /dev/null
+++ b/tests/basic/enable_post_data_reading_04.phpt
@@ -0,0 +1,23 @@
+--TEST--
+enable_post_data_reading: always_populate_raw_post_data has no effect (2)
+--INI--
+enable_post_data_reading=0
+always_populate_raw_post_data=1
+--POST_RAW--
+Content-Type: application/unknown
+a=1&b=ZYX
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+var_dump($HTTP_RAW_POST_DATA);
+var_dump(file_get_contents("php://input"));
+--EXPECTF--
+array(0) {
+}
+array(0) {
+}
+
+Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+NULL
+string(9) "a=1&b=ZYX"
diff --git a/tests/basic/php_egg_logo_guid.phpt b/tests/basic/php_egg_logo_guid.phpt
new file mode 100644
index 0000000..b3c5d7b
--- /dev/null
+++ b/tests/basic/php_egg_logo_guid.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing php_egg_logo_guid() function
+--FILE--
+<?php
+echo php_egg_logo_guid();
+?>
+--EXPECT--
+PHPE9568F36-D428-11d2-A769-00AA001ACF42
+
+--CREDITS--
+Jason Easter <easter@phpug-wuerzburg.de>
+PHPUG WÃŒrzburg <phpug-wuerzburg.de>
+Testfest 2009 2009-06-20 \ No newline at end of file
diff --git a/tests/basic/php_logo_guid.phpt b/tests/basic/php_logo_guid.phpt
new file mode 100644
index 0000000..b5724a9
--- /dev/null
+++ b/tests/basic/php_logo_guid.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Testing php_logo_guid() function
+--FILE--
+<?php
+echo php_logo_guid();
+?>
+--EXPECT--
+PHPE9568F34-D428-11d2-A769-00AA001ACF42
+--CREDITS--
+Testfest 2009 2009-06-20 \ No newline at end of file
diff --git a/tests/basic/php_real_logo_guid.phpt b/tests/basic/php_real_logo_guid.phpt
new file mode 100644
index 0000000..2b9003a
--- /dev/null
+++ b/tests/basic/php_real_logo_guid.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Testing php_real_logo_guid() function
+--FILE--
+<?php
+echo php_real_logo_guid();
+?>
+--EXPECT--
+PHPE9568F34-D428-11d2-A769-00AA001ACF42
+--CREDITS--
+Jason Easter <easter@phpug-wuerzburg.de>
+PHPUG WÃŒrzburg <phpug-wuerzburg.de>
+Testfest 2009 2009-06-20 \ No newline at end of file
diff --git a/tests/basic/req44164.phpt b/tests/basic/req44164.phpt
new file mode 100644
index 0000000..d008286
--- /dev/null
+++ b/tests/basic/req44164.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Req #44164 (Handle "Content-Length" HTTP header when zlib.output_compression active)
+--SKIPIF--
+<?php
+if (!function_exists('gzdeflate'))
+ die("skip zlib extension required");
+?>
+--INI--
+zlib.output_compression=On
+--ENV--
+HTTP_ACCEPT_ENCODING=gzip
+--FILE--
+<?php
+header("Content-length: 200");
+echo str_repeat("a", 200);
+--EXPECT--
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/tests/basic/rfc1867_anonymous_upload.phpt b/tests/basic/rfc1867_anonymous_upload.phpt
new file mode 100644
index 0000000..ce1f447
--- /dev/null
+++ b/tests/basic/rfc1867_anonymous_upload.phpt
@@ -0,0 +1,57 @@
+--TEST--
+rfc1867 anonymous upload
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1024
+max_file_uploads=10
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; filename="file2.txt"
+Content-Type: text/plain-file2
+
+2
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(2) {
+ [%d]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file1.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file1"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+ [%d]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file2.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file2"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+}
+array(0) {
+}
diff --git a/tests/basic/rfc1867_array_upload.phpt b/tests/basic/rfc1867_array_upload.phpt
new file mode 100644
index 0000000..d9f9353
--- /dev/null
+++ b/tests/basic/rfc1867_array_upload.phpt
@@ -0,0 +1,84 @@
+--TEST--
+rfc1867 array upload
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1024
+max_file_uploads=10
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file[]"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file[2]"; filename="file2.txt"
+Content-Type: text/plain-file2
+
+2
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file[]"; filename="file3.txt"
+Content-Type: text/plain-file3
+
+3
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(1) {
+ [%u|b%"file"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ array(3) {
+ [0]=>
+ %unicode|string%(9) "file1.txt"
+ [2]=>
+ %unicode|string%(9) "file2.txt"
+ [3]=>
+ %unicode|string%(9) "file3.txt"
+ }
+ [%u|b%"type"]=>
+ array(3) {
+ [0]=>
+ %unicode|string%(16) "text/plain-file1"
+ [2]=>
+ %unicode|string%(16) "text/plain-file2"
+ [3]=>
+ %unicode|string%(16) "text/plain-file3"
+ }
+ [%u|b%"tmp_name"]=>
+ array(3) {
+ [0]=>
+ %unicode|string%(%d) "%s"
+ [2]=>
+ %unicode|string%(%d) "%s"
+ [3]=>
+ %unicode|string%(%d) "%s"
+ }
+ [%u|b%"error"]=>
+ array(3) {
+ [0]=>
+ int(0)
+ [2]=>
+ int(0)
+ [3]=>
+ int(0)
+ }
+ [%u|b%"size"]=>
+ array(3) {
+ [0]=>
+ int(1)
+ [2]=>
+ int(1)
+ [3]=>
+ int(1)
+ }
+ }
+}
+array(0) {
+}
diff --git a/tests/basic/rfc1867_boundary_1.phpt b/tests/basic/rfc1867_boundary_1.phpt
new file mode 100644
index 0000000..fe0a9f2
--- /dev/null
+++ b/tests/basic/rfc1867_boundary_1.phpt
@@ -0,0 +1,25 @@
+--TEST--
+rfc1867 boundary 1
+--INI--
+post_max_size=1024
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+--POST_RAW--
+Content-Type: multipart/form-data; boundary="------------------------------------foobar"
+--------------------------------------foobar
+Content-Disposition: form-data; name="foobar"
+
+1
+--------------------------------------foobar--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(0) {
+}
+array(1) {
+ [%u|b%"foobar"]=>
+ %unicode|string%(1) "1"
+}
diff --git a/tests/basic/rfc1867_boundary_2.phpt b/tests/basic/rfc1867_boundary_2.phpt
new file mode 100644
index 0000000..256ec4b
--- /dev/null
+++ b/tests/basic/rfc1867_boundary_2.phpt
@@ -0,0 +1,25 @@
+--TEST--
+rfc1867 boundary 2
+--INI--
+post_max_size=1024
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=------------------------------------foo, bar
+--------------------------------------foo
+Content-Disposition: form-data; name="foobar"
+
+1
+--------------------------------------foo--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(0) {
+}
+array(1) {
+ [%u|b%"foobar"]=>
+ %unicode|string%(1) "1"
+}
diff --git a/tests/basic/rfc1867_empty_upload.phpt b/tests/basic/rfc1867_empty_upload.phpt
new file mode 100644
index 0000000..c2dcb9b
--- /dev/null
+++ b/tests/basic/rfc1867_empty_upload.phpt
@@ -0,0 +1,89 @@
+--TEST--
+rfc1867 empty upload
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1024
+max_file_uploads=10
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="foo"
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file2"; filename=""
+Content-Type: text/plain-file2
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file3"; filename="file3.txt"
+Content-Type: text/plain-file3
+
+3
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+}
+if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
+}
+?>
+--EXPECTF--
+array(3) {
+ [%u|b%"file1"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file1.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file1"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+ [%u|b%"file2"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(0) ""
+ [%u|b%"type"]=>
+ %string|unicode%(0) ""
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(0) ""
+ [%u|b%"error"]=>
+ int(4)
+ [%u|b%"size"]=>
+ int(0)
+ }
+ [%u|b%"file3"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file3.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file3"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+}
+array(1) {
+ [%u|b%"foo"]=>
+ %unicode|string%(0) ""
+}
+string(1) "1"
+string(1) "3"
diff --git a/tests/basic/rfc1867_file_upload_disabled.phpt b/tests/basic/rfc1867_file_upload_disabled.phpt
new file mode 100644
index 0000000..99dee9b
--- /dev/null
+++ b/tests/basic/rfc1867_file_upload_disabled.phpt
@@ -0,0 +1,36 @@
+--TEST--
+rfc1867 file_upload disabled
+--INI--
+file_uploads=0
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="foo"
+
+bar
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="bar"
+
+foo
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(0) {
+}
+array(2) {
+ [%u|b%"foo"]=>
+ %unicode|string%(3) "bar"
+ [%u|b%"bar"]=>
+ %unicode|string%(3) "foo"
+}
diff --git a/tests/basic/rfc1867_garbled_mime_headers.phpt b/tests/basic/rfc1867_garbled_mime_headers.phpt
new file mode 100644
index 0000000..4010f22
--- /dev/null
+++ b/tests/basic/rfc1867_garbled_mime_headers.phpt
@@ -0,0 +1,25 @@
+--TEST--
+rfc1867 garbled mime headers
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1024
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data
+
+
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+Warning: File Upload Mime headers garbled in %s
+array(0) {
+}
+array(0) {
+}
diff --git a/tests/basic/rfc1867_invalid_boundary.phpt b/tests/basic/rfc1867_invalid_boundary.phpt
new file mode 100644
index 0000000..cb27675
--- /dev/null
+++ b/tests/basic/rfc1867_invalid_boundary.phpt
@@ -0,0 +1,24 @@
+--TEST--
+rfc1867 invalid boundary
+--INI--
+post_max_size=1024
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+--POST_RAW--
+Content-Type: multipart/form-data; boundary="foobar
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="foobar"
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+Warning: Invalid boundary in multipart/form-data POST data in %s
+array(0) {
+}
+array(0) {
+}
diff --git a/tests/basic/rfc1867_malicious_input.phpt b/tests/basic/rfc1867_malicious_input.phpt
new file mode 100644
index 0000000..40b43d2
--- /dev/null
+++ b/tests/basic/rfc1867_malicious_input.phpt
@@ -0,0 +1,25 @@
+--TEST--
+rfc1867 malicious input
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1024
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="foo[]bar"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(0) {
+}
+array(0) {
+}
diff --git a/tests/basic/rfc1867_max_file_size.phpt b/tests/basic/rfc1867_max_file_size.phpt
new file mode 100644
index 0000000..9c576b4
--- /dev/null
+++ b/tests/basic/rfc1867_max_file_size.phpt
@@ -0,0 +1,89 @@
+--TEST--
+rfc1867 MAX_FILE_SIZE
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1024
+max_file_uploads=10
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="MAX_FILE_SIZE"
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file2"; filename="file2.txt"
+Content-Type: text/plain-file2
+
+22
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file3"; filename="C:\foo\bar/file3.txt"
+Content-Type: text/plain-file3;
+
+3
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+}
+if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
+}
+?>
+--EXPECTF--
+array(3) {
+ [%u|b%"file1"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file1.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file1"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+ [%u|b%"file2"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file2.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(0) ""
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(0) ""
+ [%u|b%"error"]=>
+ int(2)
+ [%u|b%"size"]=>
+ int(0)
+ }
+ [%u|b%"file3"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file3.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file3"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+}
+array(1) {
+ [%u|b%"MAX_FILE_SIZE"]=>
+ %string|unicode%(1) "1"
+}
+string(1) "1"
+string(1) "3"
diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt
new file mode 100644
index 0000000..76327fd
--- /dev/null
+++ b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt
@@ -0,0 +1,101 @@
+--TEST--
+rfc1867 max_file_uploads - empty files shouldn't count (non-debug version)
+--SKIPIF--
+<?php if(function_exists("leak")) print "skip only for non-debug builds"; ?>
+--INI--
+file_uploads=1
+error_reporting=E_ALL
+max_file_uploads=2
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file2"; filename=""
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file3"; filename=""
+Content-Type: text/plain-file
+
+33
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file4"; filename="file4.txt"
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+}
+if (is_uploaded_file($_FILES["file4"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file4"]["tmp_name"]));
+}
+?>
+--EXPECTF--
+array(4) {
+ ["file2"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file3"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file4"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file4.txt"
+ ["type"]=>
+ string(15) "text/plain-file"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(0)
+ }
+ ["file1"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file1.txt"
+ ["type"]=>
+ string(15) "text/plain-file"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(1)
+ }
+}
+array(0) {
+}
+string(1) "1"
+string(0) ""
diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt
new file mode 100644
index 0000000..279851c
--- /dev/null
+++ b/tests/basic/rfc1867_max_file_uploads_empty_files_debug.phpt
@@ -0,0 +1,102 @@
+--TEST--
+rfc1867 max_file_uploads - empty files shouldn't count (debug version)
+--SKIPIF--
+<?php if(!function_exists("leak")) print "skip only for debug builds"; ?>
+--INI--
+file_uploads=1
+error_reporting=E_ALL
+max_file_uploads=1
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file2"; filename=""
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file3"; filename=""
+Content-Type: text/plain-file
+
+33
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file4"; filename="file4.txt"
+Content-Type: text/plain-file
+
+
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+}
+?>
+--EXPECTF--
+Notice: No file uploaded in Unknown on line 0
+
+Notice: No file uploaded in Unknown on line 0
+
+Warning: Uploaded file size 0 - file [file4=file4.txt] not saved in Unknown on line 0
+array(4) {
+ ["file2"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file3"]=>
+ array(5) {
+ ["name"]=>
+ string(0) ""
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(4)
+ ["size"]=>
+ int(0)
+ }
+ ["file4"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file4.txt"
+ ["type"]=>
+ string(0) ""
+ ["tmp_name"]=>
+ string(0) ""
+ ["error"]=>
+ int(5)
+ ["size"]=>
+ int(0)
+ }
+ ["file1"]=>
+ array(5) {
+ ["name"]=>
+ string(9) "file1.txt"
+ ["type"]=>
+ string(15) "text/plain-file"
+ ["tmp_name"]=>
+ string(%d) "%s"
+ ["error"]=>
+ int(0)
+ ["size"]=>
+ int(1)
+ }
+}
+array(0) {
+}
+string(1) "1"
diff --git a/tests/basic/rfc1867_missing_boundary.phpt b/tests/basic/rfc1867_missing_boundary.phpt
new file mode 100644
index 0000000..6218b13
--- /dev/null
+++ b/tests/basic/rfc1867_missing_boundary.phpt
@@ -0,0 +1,24 @@
+--TEST--
+rfc1867 missing boundary
+--INI--
+post_max_size=1024
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+--POST_RAW--
+Content-Type: multipart/form-data
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="foobar"
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+Warning: Missing boundary in multipart/form-data POST data in %s
+array(0) {
+}
+array(0) {
+}
diff --git a/tests/basic/rfc1867_missing_boundary_2.phpt b/tests/basic/rfc1867_missing_boundary_2.phpt
new file mode 100644
index 0000000..a8f38ae
--- /dev/null
+++ b/tests/basic/rfc1867_missing_boundary_2.phpt
@@ -0,0 +1,37 @@
+--TEST--
+rfc1867 missing boundary 2
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1024
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+array(1) {
+ [%u|b%"file1"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file1.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(0) ""
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(0) ""
+ [%u|b%"error"]=>
+ int(3)
+ [%u|b%"size"]=>
+ int(0)
+ }
+}
+array(0) {
+}
diff --git a/tests/basic/rfc1867_post_max_filesize.phpt b/tests/basic/rfc1867_post_max_filesize.phpt
new file mode 100644
index 0000000..04c0c5c
--- /dev/null
+++ b/tests/basic/rfc1867_post_max_filesize.phpt
@@ -0,0 +1,83 @@
+--TEST--
+rfc1867 post_max_filesize
+--INI--
+file_uploads=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+upload_max_filesize=1
+max_file_uploads=10
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file1
+
+1
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file2"; filename="file2.txt"
+Content-Type: text/plain-file2
+
+22
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file3"; filename="file3.txt"
+Content-Type: text/plain-file3
+
+3
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+}
+if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
+ var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
+}
+?>
+--EXPECTF--
+array(3) {
+ [%u|b%"file1"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file1.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file1"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+ [%u|b%"file2"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file2.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(0) ""
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(0) ""
+ [%u|b%"error"]=>
+ int(1)
+ [%u|b%"size"]=>
+ int(0)
+ }
+ [%u|b%"file3"]=>
+ array(5) {
+ [%u|b%"name"]=>
+ %string|unicode%(9) "file3.txt"
+ [%u|b%"type"]=>
+ %string|unicode%(16) "text/plain-file3"
+ [%u|b%"tmp_name"]=>
+ %string|unicode%(%d) "%s"
+ [%u|b%"error"]=>
+ int(0)
+ [%u|b%"size"]=>
+ int(1)
+ }
+}
+array(0) {
+}
+string(1) "1"
+string(1) "3"
diff --git a/tests/basic/rfc1867_post_max_size.phpt b/tests/basic/rfc1867_post_max_size.phpt
new file mode 100644
index 0000000..9228135
--- /dev/null
+++ b/tests/basic/rfc1867_post_max_size.phpt
@@ -0,0 +1,24 @@
+--TEST--
+rfc1867 post_max_size
+--INI--
+post_max_size=1
+error_reporting=E_ALL&~E_NOTICE
+comment=debug builds show some additional E_NOTICE errors
+--POST_RAW--
+Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
+-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="foobar"
+
+1
+-----------------------------20896060251896012921717172737--
+--FILE--
+<?php
+var_dump($_FILES);
+var_dump($_POST);
+?>
+--EXPECTF--
+Warning: POST Content-Length of %d bytes exceeds the limit of 1 bytes in %s
+array(0) {
+}
+array(0) {
+}
diff --git a/tests/basic/zend_logo_guid.phpt b/tests/basic/zend_logo_guid.phpt
new file mode 100644
index 0000000..23ca016
--- /dev/null
+++ b/tests/basic/zend_logo_guid.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing zend_logo_guid() function
+--FILE--
+<?php
+echo zend_logo_guid();
+?>
+--EXPECT--
+PHPE9568F35-D428-11d2-A769-00AA001ACF42
+
+--CREDITS--
+Jason Easter <easter@phpug-wuerzburg.de>
+PHPUG WÃŒrzburg <phpug-wuerzburg.de>
+Testfest 2009 2009-06-20 \ No newline at end of file
diff --git a/tests/classes/__call_001.phpt b/tests/classes/__call_001.phpt
new file mode 100644
index 0000000..f9708e0
--- /dev/null
+++ b/tests/classes/__call_001.phpt
@@ -0,0 +1,42 @@
+--TEST--
+ZE2 __call()
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Caller {
+ public $x = array(1, 2, 3);
+
+ function __call($m, $a) {
+ echo "Method $m called:\n";
+ var_dump($a);
+ return $this->x;
+ }
+}
+
+$foo = new Caller();
+$a = $foo->test(1, '2', 3.4, true);
+var_dump($a);
+
+?>
+--EXPECT--
+Method test called:
+array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ string(1) "2"
+ [2]=>
+ float(3.4)
+ [3]=>
+ bool(true)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
diff --git a/tests/classes/__call_002.phpt b/tests/classes/__call_002.phpt
new file mode 100644
index 0000000..53a179f
--- /dev/null
+++ b/tests/classes/__call_002.phpt
@@ -0,0 +1,15 @@
+--TEST--
+ZE2 __call() signature check
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Test {
+ function __call() {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Method Test::__call() must take exactly 2 arguments in %s__call_002.php on line %d
diff --git a/tests/classes/__call_003.phpt b/tests/classes/__call_003.phpt
new file mode 100644
index 0000000..c7aa95c
--- /dev/null
+++ b/tests/classes/__call_003.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Force pass-by-reference to __call
+--FILE--
+<?php
+ class C
+ {
+ function __call($name, $values)
+ {
+ $values[0][0] = 'changed';
+ }
+ }
+
+ $a = array('original');
+
+ $b = array('original');
+ $hack =& $b[0];
+
+ $c = new C;
+ $c->f($a);
+ $c->f($b);
+
+ var_dump($a, $b);
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+array(1) {
+ [0]=>
+ &string(7) "changed"
+}
+
diff --git a/tests/classes/__call_004.phpt b/tests/classes/__call_004.phpt
new file mode 100644
index 0000000..2072112
--- /dev/null
+++ b/tests/classes/__call_004.phpt
@@ -0,0 +1,41 @@
+--TEST--
+When __call() is invoked via ::, ensure current scope's __call() is favoured over the specified class's __call().
+--FILE--
+<?php
+class A {
+ function __call($strMethod, $arrArgs) {
+ echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n";
+ var_dump($this);
+ }
+}
+
+class B extends A {
+ function __call($strMethod, $arrArgs) {
+ echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n";
+ var_dump($this);
+ }
+
+ function test() {
+ A::test1(1,'a');
+ B::test2(1,'a');
+ self::test3(1,'a');
+ parent::test4(1,'a');
+ }
+}
+
+$b = new B();
+$b->test();
+?>
+--EXPECTF--
+In B::__call(test1, array(1,a))
+object(B)#1 (0) {
+}
+In B::__call(test2, array(1,a))
+object(B)#1 (0) {
+}
+In B::__call(test3, array(1,a))
+object(B)#1 (0) {
+}
+In B::__call(test4, array(1,a))
+object(B)#1 (0) {
+} \ No newline at end of file
diff --git a/tests/classes/__call_005.phpt b/tests/classes/__call_005.phpt
new file mode 100644
index 0000000..6e15848
--- /dev/null
+++ b/tests/classes/__call_005.phpt
@@ -0,0 +1,37 @@
+--TEST--
+When __call() is invoked via ::, ensure private implementation of __call() in superclass is accessed without error.
+--FILE--
+<?php
+class A {
+ private function __call($strMethod, $arrArgs) {
+ echo "In " . __METHOD__ . "($strMethod, array(" . implode(',',$arrArgs) . "))\n";
+ var_dump($this);
+ }
+}
+
+class B extends A {
+ function test() {
+ A::test1(1,'a');
+ B::test2(1,'a');
+ self::test3(1,'a');
+ parent::test4(1,'a');
+ }
+}
+
+$b = new B();
+$b->test();
+?>
+--EXPECTF--
+Warning: The magic method __call() must have public visibility and cannot be static in %s__call_005.php on line 3
+In A::__call(test1, array(1,a))
+object(B)#1 (0) {
+}
+In A::__call(test2, array(1,a))
+object(B)#1 (0) {
+}
+In A::__call(test3, array(1,a))
+object(B)#1 (0) {
+}
+In A::__call(test4, array(1,a))
+object(B)#1 (0) {
+}
diff --git a/tests/classes/__call_006.phpt b/tests/classes/__call_006.phpt
new file mode 100644
index 0000000..a65fafb
--- /dev/null
+++ b/tests/classes/__call_006.phpt
@@ -0,0 +1,77 @@
+--TEST--
+Ensure exceptions are handled properly when thrown in __call.
+--FILE--
+<?php
+class A {
+ function __call($strMethod, $arrArgs) {
+ var_dump($this);
+ throw new Exception;
+ echo "You should not see this";
+ }
+ function test() {
+ A::unknownCalledWithSRO(1,2,3);
+ }
+}
+
+class B extends A {
+ function test() {
+ B::unknownCalledWithSROFromChild(1,2,3);
+ }
+}
+
+$a = new A();
+
+echo "---> Invoke __call via simple method call.\n";
+try {
+ $a->unknown();
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+
+echo "\n\n---> Invoke __call via scope resolution operator within instance.\n";
+try {
+ $a->test();
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+
+echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n";
+$b = new B();
+try {
+ $b->test();
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+
+echo "\n\n---> Invoke __call via callback.\n";
+try {
+ call_user_func(array($b, 'unknownCallback'), 1,2,3);
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+?>
+==DONE==
+--EXPECTF--
+---> Invoke __call via simple method call.
+object(A)#%d (0) {
+}
+Exception caught OK; continuing.
+
+
+---> Invoke __call via scope resolution operator within instance.
+object(A)#%d (0) {
+}
+Exception caught OK; continuing.
+
+
+---> Invoke __call via scope resolution operator within child instance.
+object(B)#%d (0) {
+}
+Exception caught OK; continuing.
+
+
+---> Invoke __call via callback.
+object(B)#%d (0) {
+}
+Exception caught OK; continuing.
+==DONE== \ No newline at end of file
diff --git a/tests/classes/__call_007.phpt b/tests/classes/__call_007.phpt
new file mode 100644
index 0000000..d79dba3
--- /dev/null
+++ b/tests/classes/__call_007.phpt
@@ -0,0 +1,74 @@
+--TEST--
+Ensure exceptions are handled properly when thrown in a statically declared __call.
+--FILE--
+<?php
+class A {
+ static function __call($strMethod, $arrArgs) {
+ @var_dump($this);
+ throw new Exception;
+ echo "You should not see this";
+ }
+ function test() {
+ A::unknownCalledWithSRO(1,2,3);
+ }
+}
+
+class B extends A {
+ function test() {
+ B::unknownCalledWithSROFromChild(1,2,3);
+ }
+}
+
+$a = new A();
+
+echo "---> Invoke __call via simple method call.\n";
+try {
+ $a->unknown();
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+
+echo "\n\n---> Invoke __call via scope resolution operator within instance.\n";
+try {
+ $a->test();
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+
+echo "\n\n---> Invoke __call via scope resolution operator within child instance.\n";
+$b = new B();
+try {
+ $b->test();
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+
+echo "\n\n---> Invoke __call via callback.\n";
+try {
+ call_user_func(array($b, 'unknownCallback'), 1,2,3);
+} catch (Exception $e) {
+ echo "Exception caught OK; continuing.\n";
+}
+?>
+==DONE==
+--EXPECTF--
+Warning: The magic method __call() must have public visibility and cannot be static in %s on line 3
+---> Invoke __call via simple method call.
+NULL
+Exception caught OK; continuing.
+
+
+---> Invoke __call via scope resolution operator within instance.
+NULL
+Exception caught OK; continuing.
+
+
+---> Invoke __call via scope resolution operator within child instance.
+NULL
+Exception caught OK; continuing.
+
+
+---> Invoke __call via callback.
+NULL
+Exception caught OK; continuing.
+==DONE== \ No newline at end of file
diff --git a/tests/classes/__set__get_001.phpt b/tests/classes/__set__get_001.phpt
new file mode 100644
index 0000000..beb688c
--- /dev/null
+++ b/tests/classes/__set__get_001.phpt
@@ -0,0 +1,72 @@
+--TEST--
+ZE2 __set() and __get()
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class setter {
+ public $n;
+ public $x = array('a' => 1, 'b' => 2, 'c' => 3);
+
+ function __get($nm) {
+ echo "Getting [$nm]\n";
+
+ if (isset($this->x[$nm])) {
+ $r = $this->x[$nm];
+ echo "Returning: $r\n";
+ return $r;
+ }
+ else {
+ echo "Nothing!\n";
+ }
+ }
+
+ function __set($nm, $val) {
+ echo "Setting [$nm] to $val\n";
+
+ if (isset($this->x[$nm])) {
+ $this->x[$nm] = $val;
+ echo "OK!\n";
+ }
+ else {
+ echo "Not OK!\n";
+ }
+ }
+}
+
+$foo = new Setter();
+
+// this doesn't go through __set()... should it?
+$foo->n = 1;
+
+// the rest are fine...
+$foo->a = 100;
+$foo->a++;
+$foo->z++;
+var_dump($foo);
+
+?>
+--EXPECTF--
+Setting [a] to 100
+OK!
+Getting [a]
+Returning: 100
+Setting [a] to 101
+OK!
+Getting [z]
+Nothing!
+Setting [z] to 1
+Not OK!
+object(setter)#%d (2) {
+ ["n"]=>
+ int(1)
+ ["x"]=>
+ array(3) {
+ ["a"]=>
+ int(101)
+ ["b"]=>
+ int(2)
+ ["c"]=>
+ int(3)
+ }
+}
diff --git a/tests/classes/__set__get_002.phpt b/tests/classes/__set__get_002.phpt
new file mode 100644
index 0000000..71111cc
--- /dev/null
+++ b/tests/classes/__set__get_002.phpt
@@ -0,0 +1,14 @@
+--TEST--
+ZE2 __get() signature check
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class Test {
+ function __get($x,$y) {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Method Test::__get() must take exactly 1 argument in %s__set__get_002.php on line %d
diff --git a/tests/classes/__set__get_003.phpt b/tests/classes/__set__get_003.phpt
new file mode 100644
index 0000000..390d303
--- /dev/null
+++ b/tests/classes/__set__get_003.phpt
@@ -0,0 +1,14 @@
+--TEST--
+ZE2 __set() signature check
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class Test {
+ function __set() {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Method Test::__set() must take exactly 2 arguments in %s__set__get_003.php on line %d
diff --git a/tests/classes/__set__get_004.phpt b/tests/classes/__set__get_004.phpt
new file mode 100644
index 0000000..e3061da
--- /dev/null
+++ b/tests/classes/__set__get_004.phpt
@@ -0,0 +1,39 @@
+--TEST--
+ZE2 __set() and __get()
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class Test {
+ protected $x;
+
+ function __get($name) {
+ if (isset($this->x[$name])) {
+ return $this->x[$name];
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+
+ function __set($name, $val) {
+ $this->x[$name] = $val;
+ }
+}
+
+$foo = new Test();
+$bar = new Test();
+$bar->baz = "Check";
+
+$foo->bar = $bar;
+
+var_dump($bar->baz);
+var_dump($foo->bar->baz);
+
+?>
+===DONE===
+--EXPECTF--
+string(5) "Check"
+string(5) "Check"
+===DONE===
diff --git a/tests/classes/__set__get_005.phpt b/tests/classes/__set__get_005.phpt
new file mode 100644
index 0000000..d8bbad3
--- /dev/null
+++ b/tests/classes/__set__get_005.phpt
@@ -0,0 +1,68 @@
+--TEST--
+ZE2 __set() and __get()
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class Test
+{
+ protected $x;
+
+ function __get($name) {
+ echo __METHOD__ . "\n";
+ if (isset($this->x[$name])) {
+ return $this->x[$name];
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+
+ function __set($name, $val) {
+ echo __METHOD__ . "\n";
+ $this->x[$name] = $val;
+ }
+}
+
+class AutoGen
+{
+ protected $x;
+
+ function __get($name) {
+ echo __METHOD__ . "\n";
+ if (!isset($this->x[$name])) {
+ $this->x[$name] = new Test();
+ }
+ return $this->x[$name];
+ }
+
+ function __set($name, $val) {
+ echo __METHOD__ . "\n";
+ $this->x[$name] = $val;
+ }
+}
+
+$foo = new AutoGen();
+$foo->bar->baz = "Check";
+
+var_dump($foo->bar);
+var_dump($foo->bar->baz);
+
+?>
+===DONE===
+--EXPECTF--
+AutoGen::__get
+Test::__set
+AutoGen::__get
+object(Test)#%d (1) {
+ ["x":protected]=>
+ array(1) {
+ ["baz"]=>
+ string(5) "Check"
+ }
+}
+AutoGen::__get
+Test::__get
+string(5) "Check"
+===DONE===
diff --git a/tests/classes/__set_data_corrupt.phpt b/tests/classes/__set_data_corrupt.phpt
new file mode 100644
index 0000000..6a52bd4
--- /dev/null
+++ b/tests/classes/__set_data_corrupt.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 Data corruption in __set
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
+--FILE--
+<?php
+$f = 'c="foo"';
+class foo {
+ const foobar=1;
+ public $pp = array('t'=>null);
+
+ function bar() {
+ echo $this->t ='f';
+ }
+ function __get($prop)
+ {
+ return $this->pp[$prop];
+ }
+ function __set($prop, $val)
+ {
+ echo "__set";
+ $this->pp[$prop] = '';
+ }
+}
+$f = new foo;
+$f->bar();
+?>
+--EXPECT--
+__setf
diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt
new file mode 100644
index 0000000..fbebf4d
--- /dev/null
+++ b/tests/classes/abstract.phpt
@@ -0,0 +1,30 @@
+--TEST--
+ZE2 An abstract method may not be called
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+abstract class fail {
+ abstract function show();
+}
+
+class pass extends fail {
+ function show() {
+ echo "Call to function show()\n";
+ }
+ function error() {
+ parent::show();
+ }
+}
+
+$t = new pass();
+$t->show();
+$t->error();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call to function show()
+
+Fatal error: Cannot call abstract method fail::show() in %s on line %d
diff --git a/tests/classes/abstract_by_interface_001.phpt b/tests/classes/abstract_by_interface_001.phpt
new file mode 100644
index 0000000..7565fdf
--- /dev/null
+++ b/tests/classes/abstract_by_interface_001.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 An abstract method may not be called
+--FILE--
+<?php
+
+class Root {
+}
+
+interface MyInterface
+{
+ function MyInterfaceFunc();
+}
+
+abstract class Derived extends Root implements MyInterface {
+}
+
+class Leaf extends Derived
+{
+ function MyInterfaceFunc() {}
+}
+
+var_dump(new Leaf);
+
+class Fails extends Root implements MyInterface {
+}
+
+?>
+===DONE===
+--EXPECTF--
+object(Leaf)#%d (0) {
+}
+
+Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_001.php on line %d
diff --git a/tests/classes/abstract_by_interface_002.phpt b/tests/classes/abstract_by_interface_002.phpt
new file mode 100644
index 0000000..77c5619
--- /dev/null
+++ b/tests/classes/abstract_by_interface_002.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 An abstract method may not be called
+--FILE--
+<?php
+
+class Root {
+}
+
+interface MyInterface
+{
+ static function MyInterfaceFunc();
+}
+
+abstract class Derived extends Root implements MyInterface {
+}
+
+class Leaf extends Derived
+{
+ static function MyInterfaceFunc() {}
+}
+
+var_dump(new Leaf);
+
+class Fails extends Root implements MyInterface {
+}
+
+?>
+===DONE===
+--EXPECTF--
+object(Leaf)#%d (0) {
+}
+
+Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_002.php on line %d
diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt
new file mode 100644
index 0000000..571a9b9
--- /dev/null
+++ b/tests/classes/abstract_class.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 An abstract class cannot be instantiated
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+abstract class fail {
+ abstract function show();
+}
+
+class pass extends fail {
+ function show() {
+ echo "Call to function show()\n";
+ }
+}
+
+$t2 = new pass();
+$t2->show();
+
+$t = new fail();
+$t->show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call to function show()
+
+Fatal error: Cannot instantiate abstract class fail in %s on line %d
diff --git a/tests/classes/abstract_derived.phpt b/tests/classes/abstract_derived.phpt
new file mode 100644
index 0000000..0feceac
--- /dev/null
+++ b/tests/classes/abstract_derived.phpt
@@ -0,0 +1,20 @@
+--TEST--
+ZE2 A derived class with an abstract method must be abstract
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class base {
+}
+
+class derived extends base {
+ abstract function show();
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+
+Fatal error: Class derived contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (derived::show) in %sabstract_derived.php on line %d
diff --git a/tests/classes/abstract_final.phpt b/tests/classes/abstract_final.phpt
new file mode 100644
index 0000000..20c7ae3
--- /dev/null
+++ b/tests/classes/abstract_final.phpt
@@ -0,0 +1,16 @@
+--TEST--
+ZE2 A final method cannot be abstract
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class fail {
+ abstract final function show();
+}
+
+echo "Done\n"; // Shouldn't be displayed
+?>
+--EXPECTF--
+
+Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d
diff --git a/tests/classes/abstract_inherit.phpt b/tests/classes/abstract_inherit.phpt
new file mode 100644
index 0000000..362ccb0
--- /dev/null
+++ b/tests/classes/abstract_inherit.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ZE2 A class that inherits an abstract method is abstract
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+abstract class pass {
+ abstract function show();
+}
+
+abstract class fail extends pass {
+}
+
+$t = new fail();
+$t = new pass();
+
+echo "Done\n"; // Shouldn't be displayed
+?>
+--EXPECTF--
+
+Fatal error: Cannot instantiate abstract class fail in %s on line %d
diff --git a/tests/classes/abstract_not_declared.phpt b/tests/classes/abstract_not_declared.phpt
new file mode 100644
index 0000000..3b81cd4
--- /dev/null
+++ b/tests/classes/abstract_not_declared.phpt
@@ -0,0 +1,15 @@
+--TEST--
+ZE2 An abstract class must be declared abstract
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class fail {
+ abstract function show();
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %s on line %d
diff --git a/tests/classes/abstract_redeclare.phpt b/tests/classes/abstract_redeclare.phpt
new file mode 100644
index 0000000..9a0a1ed
--- /dev/null
+++ b/tests/classes/abstract_redeclare.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ZE2 A method cannot be redeclared abstract
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ function show() {
+ echo "Call to function show()\n";
+ }
+}
+
+class fail extends pass {
+ abstract function show();
+}
+
+echo "Done\n"; // Shouldn't be displayed
+?>
+--EXPECTF--
+
+Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::show) in %sabstract_redeclare.php on line %d
diff --git a/tests/classes/abstract_static.phpt b/tests/classes/abstract_static.phpt
new file mode 100644
index 0000000..bcebec5
--- /dev/null
+++ b/tests/classes/abstract_static.phpt
@@ -0,0 +1,36 @@
+--TEST--
+ZE2 A static abstract methods
+--FILE--
+<?php
+
+interface showable
+{
+ static function show();
+}
+
+class pass implements showable
+{
+ static function show() {
+ echo "Call to function show()\n";
+ }
+}
+
+pass::show();
+
+eval('
+class fail
+{
+ abstract static function func();
+}
+');
+
+fail::show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call to function show()
+
+Strict Standards: Static function fail::func() should not be abstract in %sabstract_static.php(%d) : eval()'d code on line %d
+
+Fatal error: Class fail contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (fail::func) in %sabstract_static.php(%d) : eval()'d code on line %d
diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt
new file mode 100644
index 0000000..0e1ddbe
--- /dev/null
+++ b/tests/classes/abstract_user_call.phpt
@@ -0,0 +1,30 @@
+--TEST--
+ZE2 An abstrcat method cannot be called indirectly
+--FILE--
+<?php
+
+abstract class test_base
+{
+ abstract function func();
+}
+
+class test extends test_base
+{
+ function func()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+$o = new test;
+
+$o->func();
+
+call_user_func(array($o, 'test_base::func'));
+
+?>
+===DONE===
+--EXPECTF--
+test::func()
+
+Fatal error: Cannot call abstract method test_base::func() in %s on line %d
diff --git a/tests/classes/array_access_001.phpt b/tests/classes/array_access_001.phpt
new file mode 100644
index 0000000..feed3fb
--- /dev/null
+++ b/tests/classes/array_access_001.phpt
@@ -0,0 +1,198 @@
+--TEST--
+ZE2 ArrayAccess
+--FILE--
+<?php
+class object implements ArrayAccess {
+
+ public $a = array('1st', 1, 2=>'3rd', '4th'=>4);
+
+ function offsetExists($index) {
+ echo __METHOD__ . "($index)\n";
+ return array_key_exists($index, $this->a);
+ }
+ function offsetGet($index) {
+ echo __METHOD__ . "($index)\n";
+ return $this->a[$index];
+ }
+ function offsetSet($index, $newval) {
+ echo __METHOD__ . "($index,$newval)\n";
+ return $this->a[$index] = $newval;
+ }
+ function offsetUnset($index) {
+ echo __METHOD__ . "($index)\n";
+ unset($this->a[$index]);
+ }
+}
+
+$obj = new Object;
+
+var_dump($obj->a);
+
+echo "===EMPTY===\n";
+var_dump(empty($obj[0]));
+var_dump(empty($obj[1]));
+var_dump(empty($obj[2]));
+var_dump(empty($obj['4th']));
+var_dump(empty($obj['5th']));
+var_dump(empty($obj[6]));
+
+echo "===isset===\n";
+var_dump(isset($obj[0]));
+var_dump(isset($obj[1]));
+var_dump(isset($obj[2]));
+var_dump(isset($obj['4th']));
+var_dump(isset($obj['5th']));
+var_dump(isset($obj[6]));
+
+echo "===offsetGet===\n";
+var_dump($obj[0]);
+var_dump($obj[1]);
+var_dump($obj[2]);
+var_dump($obj['4th']);
+var_dump($obj['5th']);
+var_dump($obj[6]);
+
+echo "===offsetSet===\n";
+echo "WRITE 1\n";
+$obj[1] = 'Changed 1';
+var_dump($obj[1]);
+echo "WRITE 2\n";
+$obj['4th'] = 'Changed 4th';
+var_dump($obj['4th']);
+echo "WRITE 3\n";
+$obj['5th'] = 'Added 5th';
+var_dump($obj['5th']);
+echo "WRITE 4\n";
+$obj[6] = 'Added 6';
+var_dump($obj[6]);
+
+var_dump($obj[0]);
+var_dump($obj[2]);
+
+$x = $obj[6] = 'changed 6';
+var_dump($obj[6]);
+var_dump($x);
+
+echo "===unset===\n";
+var_dump($obj->a);
+unset($obj[2]);
+unset($obj['4th']);
+unset($obj[7]);
+unset($obj['8th']);
+var_dump($obj->a);
+
+?>
+===DONE===
+--EXPECTF--
+array(4) {
+ [0]=>
+ string(3) "1st"
+ [1]=>
+ int(1)
+ [2]=>
+ string(3) "3rd"
+ ["4th"]=>
+ int(4)
+}
+===EMPTY===
+object::offsetExists(0)
+object::offsetGet(0)
+bool(false)
+object::offsetExists(1)
+object::offsetGet(1)
+bool(false)
+object::offsetExists(2)
+object::offsetGet(2)
+bool(false)
+object::offsetExists(4th)
+object::offsetGet(4th)
+bool(false)
+object::offsetExists(5th)
+bool(true)
+object::offsetExists(6)
+bool(true)
+===isset===
+object::offsetExists(0)
+bool(true)
+object::offsetExists(1)
+bool(true)
+object::offsetExists(2)
+bool(true)
+object::offsetExists(4th)
+bool(true)
+object::offsetExists(5th)
+bool(false)
+object::offsetExists(6)
+bool(false)
+===offsetGet===
+object::offsetGet(0)
+string(3) "1st"
+object::offsetGet(1)
+int(1)
+object::offsetGet(2)
+string(3) "3rd"
+object::offsetGet(4th)
+int(4)
+object::offsetGet(5th)
+
+Notice: Undefined index: 5th in %sarray_access_001.php on line %d
+NULL
+object::offsetGet(6)
+
+Notice: Undefined offset: 6 in %sarray_access_001.php on line %d
+NULL
+===offsetSet===
+WRITE 1
+object::offsetSet(1,Changed 1)
+object::offsetGet(1)
+string(9) "Changed 1"
+WRITE 2
+object::offsetSet(4th,Changed 4th)
+object::offsetGet(4th)
+string(11) "Changed 4th"
+WRITE 3
+object::offsetSet(5th,Added 5th)
+object::offsetGet(5th)
+string(9) "Added 5th"
+WRITE 4
+object::offsetSet(6,Added 6)
+object::offsetGet(6)
+string(7) "Added 6"
+object::offsetGet(0)
+string(3) "1st"
+object::offsetGet(2)
+string(3) "3rd"
+object::offsetSet(6,changed 6)
+object::offsetGet(6)
+string(9) "changed 6"
+string(9) "changed 6"
+===unset===
+array(6) {
+ [0]=>
+ string(3) "1st"
+ [1]=>
+ string(9) "Changed 1"
+ [2]=>
+ string(3) "3rd"
+ ["4th"]=>
+ string(11) "Changed 4th"
+ ["5th"]=>
+ string(9) "Added 5th"
+ [6]=>
+ string(9) "changed 6"
+}
+object::offsetUnset(2)
+object::offsetUnset(4th)
+object::offsetUnset(7)
+object::offsetUnset(8th)
+array(4) {
+ [0]=>
+ string(3) "1st"
+ [1]=>
+ string(9) "Changed 1"
+ ["5th"]=>
+ string(9) "Added 5th"
+ [6]=>
+ string(9) "changed 6"
+}
+===DONE===
diff --git a/tests/classes/array_access_002.phpt b/tests/classes/array_access_002.phpt
new file mode 100644
index 0000000..68640c8
--- /dev/null
+++ b/tests/classes/array_access_002.phpt
@@ -0,0 +1,198 @@
+--TEST--
+ZE2 ArrayAccess::offsetSet without return
+--FILE--
+<?php
+class object implements ArrayAccess {
+
+ public $a = array('1st', 1, 2=>'3rd', '4th'=>4);
+
+ function offsetExists($index) {
+ echo __METHOD__ . "($index)\n";
+ return array_key_exists($index, $this->a);
+ }
+ function offsetGet($index) {
+ echo __METHOD__ . "($index)\n";
+ return $this->a[$index];
+ }
+ function offsetSet($index, $newval) {
+ echo __METHOD__ . "($index,$newval)\n";
+ /*return*/ $this->a[$index] = $newval;
+ }
+ function offsetUnset($index) {
+ echo __METHOD__ . "($index)\n";
+ unset($this->a[$index]);
+ }
+}
+
+$obj = new Object;
+
+var_dump($obj->a);
+
+echo "===EMPTY===\n";
+var_dump(empty($obj[0]));
+var_dump(empty($obj[1]));
+var_dump(empty($obj[2]));
+var_dump(empty($obj['4th']));
+var_dump(empty($obj['5th']));
+var_dump(empty($obj[6]));
+
+echo "===isset===\n";
+var_dump(isset($obj[0]));
+var_dump(isset($obj[1]));
+var_dump(isset($obj[2]));
+var_dump(isset($obj['4th']));
+var_dump(isset($obj['5th']));
+var_dump(isset($obj[6]));
+
+echo "===offsetGet===\n";
+var_dump($obj[0]);
+var_dump($obj[1]);
+var_dump($obj[2]);
+var_dump($obj['4th']);
+var_dump($obj['5th']);
+var_dump($obj[6]);
+
+echo "===offsetSet===\n";
+echo "WRITE 1\n";
+$obj[1] = 'Changed 1';
+var_dump($obj[1]);
+echo "WRITE 2\n";
+$obj['4th'] = 'Changed 4th';
+var_dump($obj['4th']);
+echo "WRITE 3\n";
+$obj['5th'] = 'Added 5th';
+var_dump($obj['5th']);
+echo "WRITE 4\n";
+$obj[6] = 'Added 6';
+var_dump($obj[6]);
+
+var_dump($obj[0]);
+var_dump($obj[2]);
+
+$x = $obj[6] = 'changed 6';
+var_dump($obj[6]);
+var_dump($x);
+
+echo "===unset===\n";
+var_dump($obj->a);
+unset($obj[2]);
+unset($obj['4th']);
+unset($obj[7]);
+unset($obj['8th']);
+var_dump($obj->a);
+
+?>
+===DONE===
+--EXPECTF--
+array(4) {
+ [0]=>
+ string(3) "1st"
+ [1]=>
+ int(1)
+ [2]=>
+ string(3) "3rd"
+ ["4th"]=>
+ int(4)
+}
+===EMPTY===
+object::offsetExists(0)
+object::offsetGet(0)
+bool(false)
+object::offsetExists(1)
+object::offsetGet(1)
+bool(false)
+object::offsetExists(2)
+object::offsetGet(2)
+bool(false)
+object::offsetExists(4th)
+object::offsetGet(4th)
+bool(false)
+object::offsetExists(5th)
+bool(true)
+object::offsetExists(6)
+bool(true)
+===isset===
+object::offsetExists(0)
+bool(true)
+object::offsetExists(1)
+bool(true)
+object::offsetExists(2)
+bool(true)
+object::offsetExists(4th)
+bool(true)
+object::offsetExists(5th)
+bool(false)
+object::offsetExists(6)
+bool(false)
+===offsetGet===
+object::offsetGet(0)
+string(3) "1st"
+object::offsetGet(1)
+int(1)
+object::offsetGet(2)
+string(3) "3rd"
+object::offsetGet(4th)
+int(4)
+object::offsetGet(5th)
+
+Notice: Undefined index: 5th in %sarray_access_002.php on line %d
+NULL
+object::offsetGet(6)
+
+Notice: Undefined offset: 6 in %sarray_access_002.php on line %d
+NULL
+===offsetSet===
+WRITE 1
+object::offsetSet(1,Changed 1)
+object::offsetGet(1)
+string(9) "Changed 1"
+WRITE 2
+object::offsetSet(4th,Changed 4th)
+object::offsetGet(4th)
+string(11) "Changed 4th"
+WRITE 3
+object::offsetSet(5th,Added 5th)
+object::offsetGet(5th)
+string(9) "Added 5th"
+WRITE 4
+object::offsetSet(6,Added 6)
+object::offsetGet(6)
+string(7) "Added 6"
+object::offsetGet(0)
+string(3) "1st"
+object::offsetGet(2)
+string(3) "3rd"
+object::offsetSet(6,changed 6)
+object::offsetGet(6)
+string(9) "changed 6"
+string(9) "changed 6"
+===unset===
+array(6) {
+ [0]=>
+ string(3) "1st"
+ [1]=>
+ string(9) "Changed 1"
+ [2]=>
+ string(3) "3rd"
+ ["4th"]=>
+ string(11) "Changed 4th"
+ ["5th"]=>
+ string(9) "Added 5th"
+ [6]=>
+ string(9) "changed 6"
+}
+object::offsetUnset(2)
+object::offsetUnset(4th)
+object::offsetUnset(7)
+object::offsetUnset(8th)
+array(4) {
+ [0]=>
+ string(3) "1st"
+ [1]=>
+ string(9) "Changed 1"
+ ["5th"]=>
+ string(9) "Added 5th"
+ [6]=>
+ string(9) "changed 6"
+}
+===DONE===
diff --git a/tests/classes/array_access_003.phpt b/tests/classes/array_access_003.phpt
new file mode 100644
index 0000000..3e63112
--- /dev/null
+++ b/tests/classes/array_access_003.phpt
@@ -0,0 +1,59 @@
+--TEST--
+ZE2 ArrayAccess::offsetGet ambiguties
+--INI--
+error_reporting=4095
+--FILE--
+<?php
+class object implements ArrayAccess {
+
+ public $a = array('1st', 1, 2=>'3rd', '4th'=>4);
+
+ function offsetExists($index) {
+ echo __METHOD__ . "($index)\n";
+ return array_key_exists($index, $this->a);
+ }
+ function offsetGet($index) {
+ echo __METHOD__ . "($index)\n";
+ switch($index) {
+ case 1:
+ $a = 'foo';
+ return $a . 'Bar';
+ case 2:
+ static $a=1;
+ return $a;
+ }
+ return $this->a[$index];
+ }
+ function offsetSet($index, $newval) {
+ echo __METHOD__ . "($index,$newval)\n";
+ if ($index==3) {
+ $this->cnt = $newval;
+ }
+ return $this->a[$index] = $newval;
+ }
+ function offsetUnset($index) {
+ echo __METHOD__ . "($index)\n";
+ unset($this->a[$index]);
+ }
+}
+
+$obj = new Object;
+
+var_dump($obj[1]);
+var_dump($obj[2]);
+$obj[2]++;
+var_dump($obj[2]);
+
+?>
+===DONE===
+--EXPECTF--
+object::offsetGet(1)
+string(6) "fooBar"
+object::offsetGet(2)
+int(1)
+object::offsetGet(2)
+
+Notice: Indirect modification of overloaded element of object has no effect in %sarray_access_003.php on line 39
+object::offsetGet(2)
+int(1)
+===DONE===
diff --git a/tests/classes/array_access_004.phpt b/tests/classes/array_access_004.phpt
new file mode 100644
index 0000000..7874967
--- /dev/null
+++ b/tests/classes/array_access_004.phpt
@@ -0,0 +1,57 @@
+--TEST--
+ZE2 ArrayAccess::offsetGet ambiguties
+--FILE--
+<?php
+class object implements ArrayAccess {
+
+ public $a = array('1st', 1, 2=>'3rd', '4th'=>4);
+
+ function offsetExists($index) {
+ echo __METHOD__ . "($index)\n";
+ return array_key_exists($index, $this->a);
+ }
+ function offsetGet($index) {
+ echo __METHOD__ . "($index)\n";
+ switch($index) {
+ case 1:
+ $a = 'foo';
+ return $a . 'Bar';
+ case 2:
+ static $a=1;
+ return $a;
+ }
+ return $this->a[$index];
+ }
+ function offsetSet($index, $newval) {
+ echo __METHOD__ . "($index,$newval)\n";
+ if ($index==3) {
+ $this->cnt = $newval;
+ }
+ return $this->a[$index] = $newval;
+ }
+ function offsetUnset($index) {
+ echo __METHOD__ . "($index)\n";
+ unset($this->a[$index]);
+ }
+}
+
+$obj = new Object;
+
+var_dump($obj[1]);
+var_dump($obj[2]);
+$obj[2]++;
+var_dump($obj[2]);
+
+?>
+===DONE===
+--EXPECTF--
+object::offsetGet(1)
+string(6) "fooBar"
+object::offsetGet(2)
+int(1)
+object::offsetGet(2)
+
+Notice: Indirect modification of overloaded element of object has no effect in %sarray_access_004.php on line 39
+object::offsetGet(2)
+int(1)
+===DONE===
diff --git a/tests/classes/array_access_005.phpt b/tests/classes/array_access_005.phpt
new file mode 100644
index 0000000..dcb873f
--- /dev/null
+++ b/tests/classes/array_access_005.phpt
@@ -0,0 +1,77 @@
+--TEST--
+ZE2 ArrayAccess and sub Arrays
+--FILE--
+<?php
+
+class Peoples implements ArrayAccess {
+ public $person;
+
+ function __construct() {
+ $this->person = array(array('name'=>'Joe'));
+ }
+
+ function offsetExists($index) {
+ return array_key_exists($this->person, $index);
+ }
+
+ function offsetGet($index) {
+ return $this->person[$index];
+ }
+
+ function offsetSet($index, $value) {
+ $this->person[$index] = $value;
+ }
+
+ function offsetUnset($index) {
+ unset($this->person[$index]);
+ }
+}
+
+$people = new Peoples;
+
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] = $people->person[0]['name'] . 'Foo';
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] .= 'Bar';
+var_dump($people->person[0]['name']);
+
+echo "---ArrayOverloading---\n";
+
+$people = new Peoples;
+
+var_dump($people[0]);
+var_dump($people[0]['name']);
+var_dump($people->person[0]['name'] . 'Foo'); // impossible to assign this since we don't return references here
+$x = $people[0]; // creates a copy
+$x['name'] .= 'Foo';
+$people[0] = $x;
+var_dump($people[0]);
+$people[0]['name'] = 'JoeFoo';
+var_dump($people[0]['name']);
+$people[0]['name'] = 'JoeFooBar';
+var_dump($people[0]['name']);
+
+?>
+===DONE===
+--EXPECTF--
+string(3) "Joe"
+string(6) "JoeFoo"
+string(9) "JoeFooBar"
+---ArrayOverloading---
+array(1) {
+ ["name"]=>
+ string(3) "Joe"
+}
+string(3) "Joe"
+string(6) "JoeFoo"
+array(1) {
+ ["name"]=>
+ string(6) "JoeFoo"
+}
+
+Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_005.php on line 46
+string(6) "JoeFoo"
+
+Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_005.php on line 48
+string(6) "JoeFoo"
+===DONE===
diff --git a/tests/classes/array_access_006.phpt b/tests/classes/array_access_006.phpt
new file mode 100644
index 0000000..342a7e5
--- /dev/null
+++ b/tests/classes/array_access_006.phpt
@@ -0,0 +1,37 @@
+--TEST--
+ZE2 ArrayAccess and ASSIGN_OP operators (+=)
+--FILE--
+<?php
+
+class OverloadedArray implements ArrayAccess {
+ public $realArray;
+
+ function __construct() {
+ $this->realArray = array(1,2,3);
+ }
+
+ function offsetExists($index) {
+ return array_key_exists($this->realArray, $index);
+ }
+
+ function offsetGet($index) {
+ return $this->realArray[$index];
+ }
+
+ function offsetSet($index, $value) {
+ $this->realArray[$index] = $value;
+ }
+
+ function offsetUnset($index) {
+ unset($this->realArray[$index]);
+ }
+}
+
+$a = new OverloadedArray;
+$a[1] += 10;
+var_dump($a[1]);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(12)
+---Done---
diff --git a/tests/classes/array_access_007.phpt b/tests/classes/array_access_007.phpt
new file mode 100644
index 0000000..42187fe
--- /dev/null
+++ b/tests/classes/array_access_007.phpt
@@ -0,0 +1,57 @@
+--TEST--
+ZE2 ArrayAccess and [] assignment
+--FILE--
+<?php
+
+class OverloadedArray implements ArrayAccess {
+ public $realArray;
+
+ function __construct() {
+ $this->realArray = array();
+ }
+
+ function offsetExists($index) {
+ return array_key_exists($this->realArray, $index);
+ }
+
+ function offsetGet($index) {
+ return $this->realArray[$index];
+ }
+
+ function offsetSet($index, $value) {
+ if (is_null($index)) {
+ $this->realArray[] = $value;
+ } else {
+ $this->realArray[$index] = $value;
+ }
+ }
+
+ function offsetUnset($index) {
+ unset($this->realArray[$index]);
+ }
+
+ function dump() {
+ var_dump($this->realArray);
+ }
+}
+
+$a = new OverloadedArray;
+$a[] = 1;
+$a[1] = 2;
+$a[2] = 3;
+$a[] = 4;
+$a->dump();
+?>
+===DONE===
+--EXPECT--
+array(4) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+}
+===DONE===
diff --git a/tests/classes/array_access_008.phpt b/tests/classes/array_access_008.phpt
new file mode 100644
index 0000000..9979889
--- /dev/null
+++ b/tests/classes/array_access_008.phpt
@@ -0,0 +1,67 @@
+--TEST--
+ZE2 ArrayAccess and ASSIGN_OP operators (.=)
+--FILE--
+<?php
+
+class Peoples implements ArrayAccess {
+ public $person;
+
+ function __construct() {
+ $this->person = array(array('name'=>'Foo'));
+ }
+
+ function offsetExists($index) {
+ return array_key_exists($this->person, $index);
+ }
+
+ function offsetGet($index) {
+ return $this->person[$index];
+ }
+
+ function offsetSet($index, $value) {
+ $this->person[$index] = $value;
+ }
+
+ function offsetUnset($index) {
+ unset($this->person[$index]);
+ }
+}
+
+$people = new Peoples;
+
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] .= 'Baz';
+var_dump($people->person[0]['name']);
+
+echo "===ArrayOverloading===\n";
+
+$people = new Peoples;
+
+var_dump($people[0]['name']);
+$people[0]['name'] = 'FooBar';
+var_dump($people[0]['name']);
+$people[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people[0]['name']);
+$people[0]['name'] .= 'Baz';
+var_dump($people[0]['name']);
+
+?>
+===DONE===
+--EXPECTF--
+string(3) "Foo"
+string(6) "FooBar"
+string(9) "FooBarBaz"
+===ArrayOverloading===
+string(3) "Foo"
+
+Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 40
+string(3) "Foo"
+
+Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 42
+string(3) "Foo"
+
+Notice: Indirect modification of overloaded element of Peoples has no effect in %sarray_access_008.php on line 44
+string(3) "Foo"
+===DONE===
diff --git a/tests/classes/array_access_009.phpt b/tests/classes/array_access_009.phpt
new file mode 100644
index 0000000..3862240
--- /dev/null
+++ b/tests/classes/array_access_009.phpt
@@ -0,0 +1,190 @@
+--TEST--
+ZE2 ArrayAccess and ArrayProxyAccess, ArrayProxy
+--FILE--
+<?php
+
+// NOTE: This will become part of SPL
+
+interface ArrayProxyAccess extends ArrayAccess
+{
+ function proxyGet($element);
+ function proxySet($element, $index, $value);
+ function proxyUnset($element, $index);
+}
+
+class ArrayProxy implements ArrayAccess
+{
+ private $object;
+ private $element;
+
+ function __construct(ArrayProxyAccess $object, $element)
+ {
+ echo __METHOD__ . "($element)\n";
+ if (!$object->offsetExists($element))
+ {
+ $object[$element] = array();
+ }
+ $this->object = $object;
+ $this->element = $element;
+ }
+
+ function offsetExists($index) {
+ echo __METHOD__ . "($this->element, $index)\n";
+ return array_key_exists($index, $this->object->proxyGet($this->element));
+ }
+
+ function offsetGet($index) {
+ echo __METHOD__ . "($this->element, $index)\n";
+ $tmp = $this->object->proxyGet($this->element);
+ return isset($tmp[$index]) ? $tmp[$index] : NULL;
+ }
+
+ function offsetSet($index, $value) {
+ echo __METHOD__ . "($this->element, $index, $value)\n";
+ $this->object->proxySet($this->element, $index, $value);
+ }
+
+ function offsetUnset($index) {
+ echo __METHOD__ . "($this->element, $index)\n";
+ $this->object->proxyUnset($this->element, $index);
+ }
+}
+
+class Peoples implements ArrayProxyAccess
+{
+ public $person;
+
+ function __construct()
+ {
+ $this->person = array(array('name'=>'Foo'));
+ }
+
+ function offsetExists($index)
+ {
+ return array_key_exists($index, $this->person);
+ }
+
+ function offsetGet($index)
+ {
+ return new ArrayProxy($this, $index);
+ }
+
+ function offsetSet($index, $value)
+ {
+ $this->person[$index] = $value;
+ }
+
+ function offsetUnset($index)
+ {
+ unset($this->person[$index]);
+ }
+
+ function proxyGet($element)
+ {
+ return $this->person[$element];
+ }
+
+ function proxySet($element, $index, $value)
+ {
+ $this->person[$element][$index] = $value;
+ }
+
+ function proxyUnset($element, $index)
+ {
+ unset($this->person[$element][$index]);
+ }
+}
+
+$people = new Peoples;
+
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] .= 'Baz';
+var_dump($people->person[0]['name']);
+
+echo "===ArrayOverloading===\n";
+
+$people = new Peoples;
+
+var_dump($people[0]);
+var_dump($people[0]['name']);
+$people[0]['name'] = 'FooBar';
+var_dump($people[0]['name']);
+$people[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people[0]['name']);
+$people[0]['name'] .= 'Baz';
+var_dump($people[0]['name']);
+unset($people[0]['name']);
+var_dump($people[0]);
+var_dump($people[0]['name']);
+$people[0]['name'] = 'BlaBla';
+var_dump($people[0]['name']);
+
+?>
+===DONE===
+--EXPECTF--
+string(3) "Foo"
+string(6) "FooBar"
+string(9) "FooBarBaz"
+===ArrayOverloading===
+ArrayProxy::__construct(0)
+object(ArrayProxy)#%d (2) {
+ ["object":"ArrayProxy":private]=>
+ object(Peoples)#%d (1) {
+ ["person"]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ ["name"]=>
+ string(3) "Foo"
+ }
+ }
+ }
+ ["element":"ArrayProxy":private]=>
+ int(0)
+}
+ArrayProxy::__construct(0)
+ArrayProxy::offsetGet(0, name)
+string(3) "Foo"
+ArrayProxy::__construct(0)
+ArrayProxy::offsetSet(0, name, FooBar)
+ArrayProxy::__construct(0)
+ArrayProxy::offsetGet(0, name)
+string(6) "FooBar"
+ArrayProxy::__construct(0)
+ArrayProxy::offsetSet(0, name, FooBarBar)
+ArrayProxy::__construct(0)
+ArrayProxy::offsetGet(0, name)
+string(9) "FooBarBar"
+ArrayProxy::__construct(0)
+ArrayProxy::offsetGet(0, name)
+ArrayProxy::offsetSet(0, name, FooBarBarBaz)
+ArrayProxy::__construct(0)
+ArrayProxy::offsetGet(0, name)
+string(12) "FooBarBarBaz"
+ArrayProxy::__construct(0)
+ArrayProxy::offsetUnset(0, name)
+ArrayProxy::__construct(0)
+object(ArrayProxy)#%d (2) {
+ ["object":"ArrayProxy":private]=>
+ object(Peoples)#%d (1) {
+ ["person"]=>
+ array(1) {
+ [0]=>
+ array(0) {
+ }
+ }
+ }
+ ["element":"ArrayProxy":private]=>
+ int(0)
+}
+ArrayProxy::__construct(0)
+ArrayProxy::offsetGet(0, name)
+NULL
+ArrayProxy::__construct(0)
+ArrayProxy::offsetSet(0, name, BlaBla)
+ArrayProxy::__construct(0)
+ArrayProxy::offsetGet(0, name)
+string(6) "BlaBla"
+===DONE===
diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt
new file mode 100644
index 0000000..ad374d2
--- /dev/null
+++ b/tests/classes/array_access_010.phpt
@@ -0,0 +1,168 @@
+--TEST--
+ZE2 ArrayAccess and ArrayReferenceProxy with references
+--FILE--
+<?php
+
+// NOTE: This will become part of SPL
+
+class ArrayReferenceProxy implements ArrayAccess
+{
+ private $object;
+ private $element;
+
+ function __construct(ArrayAccess $object, array &$element)
+ {
+ echo __METHOD__ . "(Array)\n";
+ $this->object = $object;
+ $this->element = &$element;
+ }
+
+ function offsetExists($index) {
+ echo __METHOD__ . "($this->element, $index)\n";
+ return array_key_exists($index, $this->element);
+ }
+
+ function offsetGet($index) {
+ echo __METHOD__ . "(Array, $index)\n";
+ return isset($this->element[$index]) ? $this->element[$index] : NULL;
+ }
+
+ function offsetSet($index, $value) {
+ echo __METHOD__ . "(Array, $index, $value)\n";
+ $this->element[$index] = $value;
+ }
+
+ function offsetUnset($index) {
+ echo __METHOD__ . "(Array, $index)\n";
+ unset($this->element[$index]);
+ }
+}
+
+class Peoples implements ArrayAccess
+{
+ public $person;
+
+ function __construct()
+ {
+ $this->person = array(array('name'=>'Foo'));
+ }
+
+ function offsetExists($index)
+ {
+ return array_key_exists($index, $this->person);
+ }
+
+ function offsetGet($index)
+ {
+ return new ArrayReferenceProxy($this, $this->person[$index]);
+ }
+
+ function offsetSet($index, $value)
+ {
+ $this->person[$index] = $value;
+ }
+
+ function offsetUnset($index)
+ {
+ unset($this->person[$index]);
+ }
+}
+
+$people = new Peoples;
+
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] .= 'Baz';
+var_dump($people->person[0]['name']);
+
+echo "===ArrayOverloading===\n";
+
+$people = new Peoples;
+
+var_dump($people[0]);
+var_dump($people[0]['name']);
+$people[0]['name'] = 'FooBar';
+var_dump($people[0]['name']);
+$people[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people[0]['name']);
+$people[0]['name'] .= 'Baz';
+var_dump($people[0]['name']);
+unset($people[0]['name']);
+var_dump($people[0]);
+var_dump($people[0]['name']);
+$people[0]['name'] = 'BlaBla';
+var_dump($people[0]['name']);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(3) "Foo"
+string(6) "FooBar"
+string(9) "FooBarBaz"
+===ArrayOverloading===
+ArrayReferenceProxy::__construct(Array)
+object(ArrayReferenceProxy)#%d (2) {
+ ["object":"ArrayReferenceProxy":private]=>
+ object(Peoples)#%d (1) {
+ ["person"]=>
+ array(1) {
+ [0]=>
+ &array(1) {
+ ["name"]=>
+ string(3) "Foo"
+ }
+ }
+ }
+ ["element":"ArrayReferenceProxy":private]=>
+ &array(1) {
+ ["name"]=>
+ string(3) "Foo"
+ }
+}
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetGet(Array, name)
+string(3) "Foo"
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetSet(Array, name, FooBar)
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetGet(Array, name)
+string(6) "FooBar"
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetSet(Array, name, FooBarBar)
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetGet(Array, name)
+string(9) "FooBarBar"
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetGet(Array, name)
+ArrayReferenceProxy::offsetSet(Array, name, FooBarBarBaz)
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetGet(Array, name)
+string(12) "FooBarBarBaz"
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetUnset(Array, name)
+ArrayReferenceProxy::__construct(Array)
+object(ArrayReferenceProxy)#%d (2) {
+ ["object":"ArrayReferenceProxy":private]=>
+ object(Peoples)#%d (1) {
+ ["person"]=>
+ array(1) {
+ [0]=>
+ &array(0) {
+ }
+ }
+ }
+ ["element":"ArrayReferenceProxy":private]=>
+ &array(0) {
+ }
+}
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetGet(Array, name)
+NULL
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetSet(Array, name, BlaBla)
+ArrayReferenceProxy::__construct(Array)
+ArrayReferenceProxy::offsetGet(Array, name)
+string(6) "BlaBla"
+===DONE===
diff --git a/tests/classes/array_access_011.phpt b/tests/classes/array_access_011.phpt
new file mode 100644
index 0000000..aa20a56
--- /dev/null
+++ b/tests/classes/array_access_011.phpt
@@ -0,0 +1,187 @@
+--TEST--
+ZE2 ArrayAccess and ArrayAccessReferenceProxy with references to main array
+--FILE--
+<?php
+
+// NOTE: This will become part of SPL
+
+class ArrayAccessReferenceProxy implements ArrayAccess
+{
+ private $object;
+ private $oarray;
+ private $element;
+
+ function __construct(ArrayAccess $object, array &$array, $element)
+ {
+ echo __METHOD__ . "($element)\n";
+ $this->object = $object;
+ $this->oarray = &$array;
+ $this->element = $element;
+ }
+
+ function offsetExists($index) {
+ echo __METHOD__ . "($this->element, $index)\n";
+ return array_key_exists($index, $this->oarray[$this->element]);
+ }
+
+ function offsetGet($index) {
+ echo __METHOD__ . "($this->element, $index)\n";
+ return isset($this->oarray[$this->element][$index]) ? $this->oarray[$this->element][$index] : NULL;
+ }
+
+ function offsetSet($index, $value) {
+ echo __METHOD__ . "($this->element, $index, $value)\n";
+ $this->oarray[$this->element][$index] = $value;
+ }
+
+ function offsetUnset($index) {
+ echo __METHOD__ . "($this->element, $index)\n";
+ unset($this->oarray[$this->element][$index]);
+ }
+}
+
+class Peoples implements ArrayAccess
+{
+ public $person;
+
+ function __construct()
+ {
+ $this->person = array(array('name'=>'Foo'));
+ }
+
+ function offsetExists($index)
+ {
+ return array_key_exists($index, $this->person);
+ }
+
+ function offsetGet($index)
+ {
+ if (is_array($this->person[$index]))
+ {
+ return new ArrayAccessReferenceProxy($this, $this->person, $index);
+ }
+ else
+ {
+ return $this->person[$index];
+ }
+ }
+
+ function offsetSet($index, $value)
+ {
+ $this->person[$index] = $value;
+ }
+
+ function offsetUnset($index)
+ {
+ unset($this->person[$index]);
+ }
+}
+
+$people = new Peoples;
+
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people->person[0]['name']);
+$people->person[0]['name'] .= 'Baz';
+var_dump($people->person[0]['name']);
+
+echo "===ArrayOverloading===\n";
+
+$people = new Peoples;
+
+var_dump($people[0]);
+var_dump($people[0]['name']);
+$people[0]['name'] = 'FooBar';
+var_dump($people[0]['name']);
+$people[0]['name'] = $people->person[0]['name'] . 'Bar';
+var_dump($people[0]['name']);
+$people[0]['name'] .= 'Baz';
+var_dump($people[0]['name']);
+unset($people[0]['name']);
+var_dump($people[0]);
+var_dump($people[0]['name']);
+$people[0]['name'] = 'BlaBla';
+var_dump($people[0]['name']);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(3) "Foo"
+string(6) "FooBar"
+string(9) "FooBarBaz"
+===ArrayOverloading===
+ArrayAccessReferenceProxy::__construct(0)
+object(ArrayAccessReferenceProxy)#%d (3) {
+ ["object":"ArrayAccessReferenceProxy":private]=>
+ object(Peoples)#%d (1) {
+ ["person"]=>
+ &array(1) {
+ [0]=>
+ array(1) {
+ ["name"]=>
+ string(3) "Foo"
+ }
+ }
+ }
+ ["oarray":"ArrayAccessReferenceProxy":private]=>
+ &array(1) {
+ [0]=>
+ array(1) {
+ ["name"]=>
+ string(3) "Foo"
+ }
+ }
+ ["element":"ArrayAccessReferenceProxy":private]=>
+ int(0)
+}
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetGet(0, name)
+string(3) "Foo"
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetSet(0, name, FooBar)
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetGet(0, name)
+string(6) "FooBar"
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBar)
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetGet(0, name)
+string(9) "FooBarBar"
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetGet(0, name)
+ArrayAccessReferenceProxy::offsetSet(0, name, FooBarBarBaz)
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetGet(0, name)
+string(12) "FooBarBarBaz"
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetUnset(0, name)
+ArrayAccessReferenceProxy::__construct(0)
+object(ArrayAccessReferenceProxy)#%d (3) {
+ ["object":"ArrayAccessReferenceProxy":private]=>
+ object(Peoples)#%d (1) {
+ ["person"]=>
+ &array(1) {
+ [0]=>
+ array(0) {
+ }
+ }
+ }
+ ["oarray":"ArrayAccessReferenceProxy":private]=>
+ &array(1) {
+ [0]=>
+ array(0) {
+ }
+ }
+ ["element":"ArrayAccessReferenceProxy":private]=>
+ int(0)
+}
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetGet(0, name)
+NULL
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetSet(0, name, BlaBla)
+ArrayAccessReferenceProxy::__construct(0)
+ArrayAccessReferenceProxy::offsetGet(0, name)
+string(6) "BlaBla"
+===DONE===
diff --git a/tests/classes/array_access_012.phpt b/tests/classes/array_access_012.phpt
new file mode 100644
index 0000000..8f85f29
--- /dev/null
+++ b/tests/classes/array_access_012.phpt
@@ -0,0 +1,36 @@
+--TEST--
+ZE2 ArrayAccess cannot assign by reference
+--FILE--
+<?php
+
+class ArrayAccessImpl implements ArrayAccess {
+ private $data = array();
+
+ public function offsetUnset($index) {}
+
+ public function offsetSet($index, $value) {
+ $this->data[$index] = $value;
+ }
+
+ public function offsetGet($index) {
+ return $this->data[$index];
+ }
+
+ public function offsetExists($index) {
+ return isset($this->data[$index]);
+ }
+}
+
+$data = new ArrayAccessImpl();
+$test = 'some data';
+$data['element'] = NULL; // prevent notice
+$data['element'] = &$test;
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+
+Notice: Indirect modification of overloaded element of ArrayAccessImpl has no effect in %sarray_access_012.php on line 24
+
+Fatal error: Cannot assign by reference to overloaded object in %sarray_access_012.php on line 24
diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt
new file mode 100644
index 0000000..206d9d5
--- /dev/null
+++ b/tests/classes/array_access_013.phpt
@@ -0,0 +1,58 @@
+--TEST--
+ZE2 ArrayAccess and exceptions
+--FILE--
+<?php
+
+class Test implements ArrayAccess
+{
+ public function offsetExists($offset) { throw new Exception(__METHOD__); return false; }
+ public function offsetGet($offset) { throw new Exception(__METHOD__); return $offset; }
+ public function offsetSet($offset, $data ) { throw new Exception(__METHOD__); }
+ public function offsetUnset($offset) { throw new Exception(__METHOD__); }
+}
+
+$t = new Test;
+
+try
+{
+ echo isset($t[0]);
+}
+catch(Exception $e)
+{
+ echo "Caught in " . $e->getMessage() . "()\n";
+}
+
+try
+{
+ echo $t[0];
+}
+catch(Exception $e)
+{
+ echo "Caught in " . $e->getMessage() . "()\n";
+}
+
+try
+{
+ $t[0] = 1;
+}
+catch(Exception $e)
+{
+ echo "Caught in " . $e->getMessage() . "()\n";
+}
+
+try
+{
+ unset($t[0]);
+}
+catch(Exception $e)
+{
+ echo "Caught in " . $e->getMessage() . "()\n";
+}
+?>
+===DONE===
+--EXPECT--
+Caught in Test::offsetExists()
+Caught in Test::offsetGet()
+Caught in Test::offsetSet()
+Caught in Test::offsetUnset()
+===DONE===
diff --git a/tests/classes/arrayobject_001.phpt b/tests/classes/arrayobject_001.phpt
new file mode 100644
index 0000000..b75f8c7
--- /dev/null
+++ b/tests/classes/arrayobject_001.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Ensure that ArrayObject acts like an array
+--FILE--
+<?php
+
+$a = new ArrayObject;
+$a['foo'] = 'bar';
+echo reset($a);
+echo count($a);
+echo current($a);
+?>
+--EXPECT--
+bar1bar
diff --git a/tests/classes/assign_op_property_001.phpt b/tests/classes/assign_op_property_001.phpt
new file mode 100644
index 0000000..21e131c
--- /dev/null
+++ b/tests/classes/assign_op_property_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 assign_op property of overloaded object
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property == "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property == "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$obj->a += 2;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(4)
+---Done---
diff --git a/tests/classes/autoload_001.phpt b/tests/classes/autoload_001.phpt
new file mode 100644
index 0000000..6f325f4
--- /dev/null
+++ b/tests/classes/autoload_001.phpt
@@ -0,0 +1,24 @@
+--TEST--
+ZE2 Autoload and class_exists
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
+ if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
+?>
+--FILE--
+<?php
+
+function __autoload($class_name)
+{
+ require_once(dirname(__FILE__) . '/' . $class_name . '.p5c');
+ echo __FUNCTION__ . '(' . $class_name . ")\n";
+}
+
+var_dump(class_exists('autoload_root'));
+
+?>
+===DONE===
+--EXPECT--
+__autoload(autoload_root)
+bool(true)
+===DONE===
diff --git a/tests/classes/autoload_002.phpt b/tests/classes/autoload_002.phpt
new file mode 100644
index 0000000..27dea0f
--- /dev/null
+++ b/tests/classes/autoload_002.phpt
@@ -0,0 +1,27 @@
+--TEST--
+ZE2 Autoload and get_class_methods
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
+ if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
+?>
+--FILE--
+<?php
+
+function __autoload($class_name)
+{
+ require_once(dirname(__FILE__) . '/' . $class_name . '.p5c');
+ echo __FUNCTION__ . '(' . $class_name . ")\n";
+}
+
+var_dump(get_class_methods('autoload_root'));
+
+?>
+===DONE===
+--EXPECT--
+__autoload(autoload_root)
+array(1) {
+ [0]=>
+ string(12) "testFunction"
+}
+===DONE===
diff --git a/tests/classes/autoload_003.phpt b/tests/classes/autoload_003.phpt
new file mode 100644
index 0000000..7bdb5da
--- /dev/null
+++ b/tests/classes/autoload_003.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ZE2 Autoload and derived classes
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
+ if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
+?>
+--FILE--
+<?php
+
+function __autoload($class_name)
+{
+ require_once(dirname(__FILE__) . '/' . $class_name . '.p5c');
+ echo __FUNCTION__ . '(' . $class_name . ")\n";
+}
+
+var_dump(class_exists('autoload_derived'));
+
+?>
+===DONE===
+--EXPECT--
+__autoload(autoload_root)
+__autoload(autoload_derived)
+bool(true)
+===DONE===
diff --git a/tests/classes/autoload_004.phpt b/tests/classes/autoload_004.phpt
new file mode 100644
index 0000000..23aea5d
--- /dev/null
+++ b/tests/classes/autoload_004.phpt
@@ -0,0 +1,28 @@
+--TEST--
+ZE2 Autoload and recursion
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
+ if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
+?>
+--FILE--
+<?php
+
+function __autoload($class_name)
+{
+ var_dump(class_exists($class_name));
+ require_once(dirname(__FILE__) . '/' . $class_name . '.p5c');
+ echo __FUNCTION__ . '(' . $class_name . ")\n";
+}
+
+var_dump(class_exists('autoload_derived'));
+
+?>
+===DONE===
+--EXPECT--
+bool(false)
+bool(false)
+__autoload(autoload_root)
+__autoload(autoload_derived)
+bool(true)
+===DONE===
diff --git a/tests/classes/autoload_005.phpt b/tests/classes/autoload_005.phpt
new file mode 100644
index 0000000..36a4e18
--- /dev/null
+++ b/tests/classes/autoload_005.phpt
@@ -0,0 +1,45 @@
+--TEST--
+ZE2 Autoload from destructor
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
+ if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
+?>
+--FILE--
+<?php
+
+function __autoload($class_name)
+{
+ var_dump(class_exists($class_name, false));
+ require_once(dirname(__FILE__) . '/' . $class_name . '.p5c');
+ echo __FUNCTION__ . '(' . $class_name . ")\n";
+}
+
+var_dump(class_exists('autoload_derived', false));
+var_dump(class_exists('autoload_derived', false));
+
+class Test
+{
+ function __destruct() {
+ echo __METHOD__ . "\n";
+ $o = new autoload_derived;
+ var_dump($o);
+ }
+}
+
+$o = new Test;
+unset($o);
+
+?>
+===DONE===
+--EXPECTF--
+bool(false)
+bool(false)
+Test::__destruct
+bool(false)
+bool(false)
+__autoload(autoload_root)
+__autoload(autoload_derived)
+object(autoload_derived)#%d (0) {
+}
+===DONE===
diff --git a/tests/classes/autoload_006.phpt b/tests/classes/autoload_006.phpt
new file mode 100644
index 0000000..9af6fc9
--- /dev/null
+++ b/tests/classes/autoload_006.phpt
@@ -0,0 +1,40 @@
+--TEST--
+ZE2 Autoload from destructor
+--SKIPIF--
+<?php
+ if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed');
+ if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already');
+?>
+--FILE--
+<?php
+
+function __autoload($class_name)
+{
+ require_once(dirname(__FILE__) . '/' . strtolower($class_name) . '.p5c');
+ echo __FUNCTION__ . '(' . $class_name . ")\n";
+}
+
+var_dump(interface_exists('autoload_interface', false));
+var_dump(class_exists('autoload_implements', false));
+
+$o = new Autoload_Implements;
+var_dump($o);
+var_dump($o instanceof autoload_interface);
+unset($o);
+
+var_dump(interface_exists('autoload_interface', false));
+var_dump(class_exists('autoload_implements', false));
+
+?>
+===DONE===
+--EXPECTF--
+bool(false)
+bool(false)
+__autoload(autoload_interface)
+__autoload(Autoload_Implements)
+object(autoload_implements)#%d (0) {
+}
+bool(true)
+bool(true)
+bool(true)
+===DONE===
diff --git a/tests/classes/autoload_007.phpt b/tests/classes/autoload_007.phpt
new file mode 100644
index 0000000..5652c12
--- /dev/null
+++ b/tests/classes/autoload_007.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Ensure instanceof does not trigger autoload.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ $a = new stdClass;
+ var_dump($a instanceof UndefC);
+?>
+--EXPECTF--
+bool(false)
diff --git a/tests/classes/autoload_008.phpt b/tests/classes/autoload_008.phpt
new file mode 100644
index 0000000..75a9cd0
--- /dev/null
+++ b/tests/classes/autoload_008.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Ensure catch blocks for unknown exception types do not trigger autoload.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ function f()
+ {
+ throw new Exception();
+ }
+ try {
+ f();
+ }
+ catch (UndefC $u) {
+ echo "In UndefClass catch block.\n";
+ }
+ catch (Exception $e) {
+ echo "In Exception catch block. Autoload should not have been triggered.\n";
+ }
+?>
+--EXPECTF--
+In Exception catch block. Autoload should not have been triggered.
diff --git a/tests/classes/autoload_009.phpt b/tests/classes/autoload_009.phpt
new file mode 100644
index 0000000..46f6055
--- /dev/null
+++ b/tests/classes/autoload_009.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Ensure type hints for unknown types do not trigger autoload.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ function f(UndefClass $x)
+ {
+ }
+ f(new stdClass);
+?>
+--EXPECTF--
+
+Catchable fatal error: Argument 1 passed to f() must be an instance of UndefClass, instance of stdClass given, called in %s
+
+
diff --git a/tests/classes/autoload_010.phpt b/tests/classes/autoload_010.phpt
new file mode 100644
index 0000000..104f688
--- /dev/null
+++ b/tests/classes/autoload_010.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Ensure implements does trigger autoload.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ class C implements UndefI
+ {
+ }
+?>
+--EXPECTF--
+In autoload: string(6) "UndefI"
+
+Fatal error: Interface 'UndefI' not found in %s on line %d
diff --git a/tests/classes/autoload_011.phpt b/tests/classes/autoload_011.phpt
new file mode 100644
index 0000000..86858d5
--- /dev/null
+++ b/tests/classes/autoload_011.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Ensure extends does trigger autoload.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ class C extends UndefBase
+ {
+ }
+?>
+--EXPECTF--
+In autoload: string(9) "UndefBase"
+
+Fatal error: Class 'UndefBase' not found in %s on line %d
diff --git a/tests/classes/autoload_012.phpt b/tests/classes/autoload_012.phpt
new file mode 100644
index 0000000..d6750b7
--- /dev/null
+++ b/tests/classes/autoload_012.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Ensure callback methods in unknown classes trigger autoload.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+ call_user_func("UndefC::test");
+?>
+--EXPECTF--
+In autoload: string(6) "UndefC"
+
+Warning: call_user_func() expects parameter 1 to be a valid callback, class 'UndefC' not found in %s on line %d
diff --git a/tests/classes/autoload_013.phpt b/tests/classes/autoload_013.phpt
new file mode 100644
index 0000000..4309cea
--- /dev/null
+++ b/tests/classes/autoload_013.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Ensure the ReflectionClass constructor triggers autoload.
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ try {
+ new ReflectionClass("UndefC");
+ }
+ catch (ReflectionException $e) {
+ echo $e->getMessage();
+ }
+?>
+--EXPECTF--
+In autoload: string(6) "UndefC"
+Class UndefC does not exist
diff --git a/tests/classes/autoload_014.phpt b/tests/classes/autoload_014.phpt
new file mode 100644
index 0000000..a3f04b7
--- /dev/null
+++ b/tests/classes/autoload_014.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Ensure the ReflectionMethod constructor triggers autoload.
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ try {
+ new ReflectionMethod("UndefC::test");
+ }
+ catch (ReflectionException $e) {
+ echo $e->getMessage();
+ }
+?>
+--EXPECTF--
+In autoload: string(6) "UndefC"
+Class UndefC does not exist
diff --git a/tests/classes/autoload_015.phpt b/tests/classes/autoload_015.phpt
new file mode 100644
index 0000000..2b14a0d
--- /dev/null
+++ b/tests/classes/autoload_015.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Ensure the ReflectionProperty constructor triggers autoload.
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ try {
+ new ReflectionProperty('UndefC', 'p');
+ }
+ catch (ReflectionException $e) {
+ echo $e->getMessage();
+ }
+?>
+--EXPECTF--
+In autoload: string(6) "UndefC"
+Class UndefC does not exist
diff --git a/tests/classes/autoload_016.phpt b/tests/classes/autoload_016.phpt
new file mode 100644
index 0000000..60263ba
--- /dev/null
+++ b/tests/classes/autoload_016.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Ensure ReflectionClass::getProperty() triggers autoload
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ $rc = new ReflectionClass("stdClass");
+
+ try {
+ $rc->getProperty("UndefC::p");
+ } catch (ReflectionException $e) {
+ echo $e->getMessage();
+ }
+?>
+--EXPECTF--
+In autoload: string(6) "undefc"
+Class undefc does not exist
diff --git a/tests/classes/autoload_017.phpt b/tests/classes/autoload_017.phpt
new file mode 100644
index 0000000..26de9fd
--- /dev/null
+++ b/tests/classes/autoload_017.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Ensure ReflectionClass::implementsInterface triggers autoload.
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "In autoload: ";
+ var_dump($name);
+ }
+
+ $rc = new ReflectionClass("stdClass");
+
+ try {
+ $rc->implementsInterface("UndefI");
+ } catch (ReflectionException $e) {
+ echo $e->getMessage();
+ }
+?>
+--EXPECTF--
+In autoload: string(6) "UndefI"
+Interface UndefI does not exist \ No newline at end of file
diff --git a/tests/classes/autoload_018.phpt b/tests/classes/autoload_018.phpt
new file mode 100644
index 0000000..59e20e2
--- /dev/null
+++ b/tests/classes/autoload_018.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Ensure __autoload() allows for recursive calls if the class name differs.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "IN: " . __METHOD__ . "($name)\n";
+
+ static $i = 0;
+ if ($i++ > 10) {
+ echo "-> Recursion detected - as expected.\n";
+ return;
+ }
+
+ class_exists('UndefinedClass' . $i);
+
+ echo "OUT: " . __METHOD__ . "($name)\n";
+ }
+
+ var_dump(class_exists('UndefinedClass0'));
+?>
+--EXPECTF--
+IN: __autoload(UndefinedClass0)
+IN: __autoload(UndefinedClass1)
+IN: __autoload(UndefinedClass2)
+IN: __autoload(UndefinedClass3)
+IN: __autoload(UndefinedClass4)
+IN: __autoload(UndefinedClass5)
+IN: __autoload(UndefinedClass6)
+IN: __autoload(UndefinedClass7)
+IN: __autoload(UndefinedClass8)
+IN: __autoload(UndefinedClass9)
+IN: __autoload(UndefinedClass10)
+IN: __autoload(UndefinedClass11)
+-> Recursion detected - as expected.
+OUT: __autoload(UndefinedClass10)
+OUT: __autoload(UndefinedClass9)
+OUT: __autoload(UndefinedClass8)
+OUT: __autoload(UndefinedClass7)
+OUT: __autoload(UndefinedClass6)
+OUT: __autoload(UndefinedClass5)
+OUT: __autoload(UndefinedClass4)
+OUT: __autoload(UndefinedClass3)
+OUT: __autoload(UndefinedClass2)
+OUT: __autoload(UndefinedClass1)
+OUT: __autoload(UndefinedClass0)
+bool(false)
+
diff --git a/tests/classes/autoload_019.phpt b/tests/classes/autoload_019.phpt
new file mode 100644
index 0000000..7836320
--- /dev/null
+++ b/tests/classes/autoload_019.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Ensure __autoload() recursion is guarded for multiple lookups of same class using difference case.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo __FUNCTION__ . " $name\n";
+ class_exists("undefinedCLASS");
+ }
+
+ class_exists("unDefinedClass");
+?>
+--EXPECTF--
+__autoload unDefinedClass
diff --git a/tests/classes/autoload_020.phpt b/tests/classes/autoload_020.phpt
new file mode 100644
index 0000000..a88e561
--- /dev/null
+++ b/tests/classes/autoload_020.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Ensure __autoload() is triggered during unserialization.
+--FILE--
+<?php
+ function __autoload($name)
+ {
+ echo "in autoload: $name\n";
+ }
+
+ var_dump(unserialize('O:1:"C":0:{}'));
+?>
+--EXPECTF--
+in autoload: C
+object(__PHP_Incomplete_Class)#%d (1) {
+ ["__PHP_Incomplete_Class_Name"]=>
+ string(1) "C"
+}
diff --git a/tests/classes/autoload_derived.p5c b/tests/classes/autoload_derived.p5c
new file mode 100755
index 0000000..93a4b35
--- /dev/null
+++ b/tests/classes/autoload_derived.p5c
@@ -0,0 +1,6 @@
+<?php
+
+class autoload_derived extends autoload_root {
+}
+
+?> \ No newline at end of file
diff --git a/tests/classes/autoload_implements.p5c b/tests/classes/autoload_implements.p5c
new file mode 100755
index 0000000..2c3479c
--- /dev/null
+++ b/tests/classes/autoload_implements.p5c
@@ -0,0 +1,10 @@
+<?php
+
+class autoload_implements implements autoload_interface {
+ function testFunction()
+ {
+ return true;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/classes/autoload_interface.p5c b/tests/classes/autoload_interface.p5c
new file mode 100755
index 0000000..6908155
--- /dev/null
+++ b/tests/classes/autoload_interface.p5c
@@ -0,0 +1,7 @@
+<?php
+
+interface autoload_interface {
+ function testFunction();
+}
+
+?> \ No newline at end of file
diff --git a/tests/classes/autoload_root.p5c b/tests/classes/autoload_root.p5c
new file mode 100755
index 0000000..9559d36
--- /dev/null
+++ b/tests/classes/autoload_root.p5c
@@ -0,0 +1,10 @@
+<?php
+
+class autoload_root {
+ function testFunction()
+ {
+ return true;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/classes/bug23951.phpt b/tests/classes/bug23951.phpt
new file mode 100644
index 0000000..2e272b8
--- /dev/null
+++ b/tests/classes/bug23951.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #23951 (Defines not working in inherited classes)
+--FILE--
+<?php
+
+define('FOO1', 1);
+define('FOO2', 2);
+
+class A {
+
+ public $a_var = array(FOO1=>'foo1_value', FOO2=>'foo2_value');
+
+}
+
+class B extends A {
+
+ public $b_var = 'foo';
+
+}
+
+$a = new A;
+$b = new B;
+
+print_r($a);
+print_r($b->a_var);
+print_r($b->b_var);
+
+?>
+--EXPECT--
+A Object
+(
+ [a_var] => Array
+ (
+ [1] => foo1_value
+ [2] => foo2_value
+ )
+
+)
+Array
+(
+ [1] => foo1_value
+ [2] => foo2_value
+)
+foo
diff --git a/tests/classes/bug24399.phpt b/tests/classes/bug24399.phpt
new file mode 100644
index 0000000..fedf8e5
--- /dev/null
+++ b/tests/classes/bug24399.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #24399 (is_subclass_of() crashes when parent class doesn't exist)
+--FILE--
+<?php
+class dooh {
+ public $blah;
+}
+$d = new dooh;
+var_dump(is_subclass_of($d, 'dooh'));
+?>
+--EXPECT--
+bool(false)
diff --git a/tests/classes/bug24445.phpt b/tests/classes/bug24445.phpt
new file mode 100644
index 0000000..af08307
--- /dev/null
+++ b/tests/classes/bug24445.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #24445 (get_parent_class() returns the current class when passed an object)
+--FILE--
+<?php
+class Test { }
+var_dump(get_parent_class('Test'));
+$t = new Test;
+var_dump(get_parent_class($t));
+?>
+--EXPECT--
+bool(false)
+bool(false)
diff --git a/tests/classes/bug26737.phpt b/tests/classes/bug26737.phpt
new file mode 100644
index 0000000..e190318
--- /dev/null
+++ b/tests/classes/bug26737.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #26737 (Protected and private variables are not saved on serialization when a user defined __sleep is used)
+--FILE--
+<?php
+class foo
+{
+ private $private = 'private';
+ protected $protected = 'protected';
+ public $public = 'public';
+
+ public function __sleep()
+ {
+ return array('private', 'protected', 'public', 'no_such');
+ }
+}
+$foo = new foo();
+$data = serialize($foo);
+var_dump(str_replace("\0", '\0', $data));
+?>
+--EXPECTF--
+Notice: serialize(): "no_such" returned as member variable from __sleep() but does not exist in %s on line %d
+string(130) "O:3:"foo":4:{s:12:"\0foo\0private";s:7:"private";s:12:"\0*\0protected";s:9:"protected";s:6:"public";s:6:"public";s:7:"no_such";N;}"
diff --git a/tests/classes/bug27468.phpt b/tests/classes/bug27468.phpt
new file mode 100644
index 0000000..58a7b6c
--- /dev/null
+++ b/tests/classes/bug27468.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #27468 (foreach in __destruct() causes segfault)
+--FILE--
+<?php
+class foo {
+ function __destruct() {
+ foreach ($this->x as $x);
+ }
+}
+new foo();
+echo 'OK';
+?>
+--EXPECTF--
+Notice: Undefined property: foo::$x in %sbug27468.php on line 4
+
+Warning: Invalid argument supplied for foreach() in %sbug27468.php on line 4
+OK
diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt
new file mode 100644
index 0000000..5f2c5a0
--- /dev/null
+++ b/tests/classes/bug27504.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #27504 (call_user_func_array allows calling of private/protected methods)
+--FILE--
+<?php
+ class foo {
+ function __construct () {
+ $this->bar('1');
+ }
+ private function bar ( $param ) {
+ echo 'Called function foo:bar('.$param.')'."\n";
+ }
+ }
+
+ $foo = new foo();
+
+ call_user_func_array( array( $foo , 'bar' ) , array( '2' ) );
+
+ $foo->bar('3');
+?>
+--EXPECTF--
+Called function foo:bar(1)
+
+Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method foo::bar() in %s on line %d
+
+Fatal error: Call to private method foo::bar() from context '' in %s on line %d
diff --git a/tests/classes/bug29446.phpt b/tests/classes/bug29446.phpt
new file mode 100644
index 0000000..5e30e8e
--- /dev/null
+++ b/tests/classes/bug29446.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #29446 (ZE allows multiple declarations of the same class constant)
+--FILE--
+<?php
+
+class testClass {
+ const TEST_CONST = 'test';
+ const TEST_CONST = 'test1';
+
+ function testClass() {
+ echo self::TEST_CONST;
+ }
+}
+
+$test = new testClass;
+
+?>
+--EXPECTF--
+Fatal error: Cannot redefine class constant testClass::TEST_CONST in %s on line 5 \ No newline at end of file
diff --git a/tests/classes/bug63462.phpt b/tests/classes/bug63462.phpt
new file mode 100644
index 0000000..dc5edbd
--- /dev/null
+++ b/tests/classes/bug63462.phpt
@@ -0,0 +1,71 @@
+--TEST--
+Test script to verify that magic methods should be called only once when accessing an unset property.
+--CREDITS--
+Marco Pivetta <ocramius@gmail.com>
+--XFAIL--
+Bug 63462 is not yet fixed
+--FILE--
+<?php
+class Test {
+ public $publicProperty;
+ protected $protectedProperty;
+ private $privateProperty;
+
+ public function __construct() {
+ unset(
+ $this->publicProperty,
+ $this->protectedProperty,
+ $this->privateProperty
+ );
+ }
+
+ function __get($name) {
+ echo '__get ' . $name . "\n";
+ return $this->$name;
+ }
+
+ function __set($name, $value) {
+ echo '__set ' . $name . "\n";
+ $this->$name = $value;
+ }
+
+ function __isset($name) {
+ echo '__isset ' . $name . "\n";
+ return isset($this->$name);
+ }
+}
+
+$test = new Test();
+
+$test->nonExisting;
+$test->publicProperty;
+$test->protectedProperty;
+$test->privateProperty;
+isset($test->nonExisting);
+isset($test->publicProperty);
+isset($test->protectedProperty);
+isset($test->privateProperty);
+$test->nonExisting = 'value';
+$test->publicProperty = 'value';
+$test->protectedProperty = 'value';
+$test->privateProperty = 'value';
+
+?>
+
+--EXPECTF--
+__get nonExisting
+Notice: Undefined index: nonExisting in %__set__get_006.php on line %d
+__get publicProperty
+Notice: Undefined index: publicProperty in %__set__get_006.php on line %d
+__get protectedProperty
+Notice: Undefined index: protectedProperty in %__set__get_006.php on line %d
+__get privateProperty
+Notice: Undefined index: privateProperty in %__set__get_006.php on line %d
+__isset nonExisting
+__isset publicProperty
+__isset protectedProperty
+__isset privateProperty
+__set nonExisting
+__set publicProperty
+__set protectedProperty
+__set privateProperty
diff --git a/tests/classes/class_abstract.phpt b/tests/classes/class_abstract.phpt
new file mode 100644
index 0000000..880f849
--- /dev/null
+++ b/tests/classes/class_abstract.phpt
@@ -0,0 +1,28 @@
+--TEST--
+ZE2 An abstract class cannot be instanciated
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+abstract class base {
+ function show() {
+ echo "base\n";
+ }
+}
+
+class derived extends base {
+}
+
+$t = new derived();
+$t->show();
+
+$t = new base();
+$t->show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+base
+
+Fatal error: Cannot instantiate abstract class base in %s on line %d
diff --git a/tests/classes/class_example.phpt b/tests/classes/class_example.phpt
new file mode 100644
index 0000000..621958b
--- /dev/null
+++ b/tests/classes/class_example.phpt
@@ -0,0 +1,85 @@
+--TEST--
+Classes general test
+--FILE--
+
+<?php
+
+/* pretty nifty object oriented code! */
+
+class user {
+ public $first_name,$family_name,$address,$phone_num;
+ function display()
+ {
+ echo "User information\n";
+ echo "----------------\n\n";
+ echo "First name:\t ".$this->first_name."\n";
+ echo "Family name:\t ".$this->family_name."\n";
+ echo "Address:\t ".$this->address."\n";
+ echo "Phone:\t\t ".$this->phone_num."\n";
+ echo "\n\n";
+ }
+ function initialize($first_name,$family_name,$address,$phone_num)
+ {
+ $this->first_name = $first_name;
+ $this->family_name = $family_name;
+ $this->address = $address;
+ $this->phone_num = $phone_num;
+ }
+};
+
+
+function test($u)
+{ /* one can pass classes as arguments */
+ $u->display();
+ $t = $u;
+ $t->address = "New address...";
+ return $t; /* and also return them as return values */
+}
+
+$user1 = new user;
+$user2 = new user;
+
+$user1->initialize("Zeev","Suraski","Ben Gourion 3, Kiryat Bialik, Israel","+972-4-8713139");
+$user2->initialize("Andi","Gutmans","Haifa, Israel","+972-4-8231621");
+$user1->display();
+$user2->display();
+
+$tmp = test($user2);
+$tmp->display();
+
+?>
+--EXPECT--
+User information
+----------------
+
+First name: Zeev
+Family name: Suraski
+Address: Ben Gourion 3, Kiryat Bialik, Israel
+Phone: +972-4-8713139
+
+
+User information
+----------------
+
+First name: Andi
+Family name: Gutmans
+Address: Haifa, Israel
+Phone: +972-4-8231621
+
+
+User information
+----------------
+
+First name: Andi
+Family name: Gutmans
+Address: Haifa, Israel
+Phone: +972-4-8231621
+
+
+User information
+----------------
+
+First name: Andi
+Family name: Gutmans
+Address: New address...
+Phone: +972-4-8231621
diff --git a/tests/classes/class_final.phpt b/tests/classes/class_final.phpt
new file mode 100644
index 0000000..5c73cb2
--- /dev/null
+++ b/tests/classes/class_final.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ZE2 A final class cannot be inherited
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+final class base {
+ function show() {
+ echo "base\n";
+ }
+}
+
+$t = new base();
+
+class derived extends base {
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Class derived may not inherit from final class (base) in %s on line %d
diff --git a/tests/classes/class_stdclass.phpt b/tests/classes/class_stdclass.phpt
new file mode 100644
index 0000000..5e3422a
--- /dev/null
+++ b/tests/classes/class_stdclass.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Instantiate stdClass
+--FILE--
+<?php
+
+$obj = new stdClass;
+
+echo get_class($obj)."\n";
+
+echo "Done\n";
+?>
+--EXPECTF--
+stdClass
+Done
diff --git a/tests/classes/clone_001.phpt b/tests/classes/clone_001.phpt
new file mode 100644
index 0000000..eb06c1f
--- /dev/null
+++ b/tests/classes/clone_001.phpt
@@ -0,0 +1,43 @@
+--TEST--
+ZE2 object cloning, 1
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+ public $p1 = 1;
+ public $p2 = 2;
+ public $p3;
+};
+
+$obj = new test;
+$obj->p2 = 'A';
+$obj->p3 = 'B';
+$copy = clone $obj;
+$copy->p3 = 'C';
+echo "Object\n";
+var_dump($obj);
+echo "Clown\n";
+var_dump($copy);
+echo "Done\n";
+?>
+--EXPECT--
+Object
+object(test)#1 (3) {
+ ["p1"]=>
+ int(1)
+ ["p2"]=>
+ string(1) "A"
+ ["p3"]=>
+ string(1) "B"
+}
+Clown
+object(test)#2 (3) {
+ ["p1"]=>
+ int(1)
+ ["p2"]=>
+ string(1) "A"
+ ["p3"]=>
+ string(1) "C"
+}
+Done
diff --git a/tests/classes/clone_002.phpt b/tests/classes/clone_002.phpt
new file mode 100644
index 0000000..4430a2c
--- /dev/null
+++ b/tests/classes/clone_002.phpt
@@ -0,0 +1,45 @@
+--TEST--
+ZE2 object cloning, 2
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+ public $p1 = 1;
+ public $p2 = 2;
+ public $p3;
+ public function __clone() {
+ }
+};
+
+$obj = new test;
+$obj->p2 = 'A';
+$obj->p3 = 'B';
+$copy = clone $obj;
+$copy->p3 = 'C';
+echo "Object\n";
+var_dump($obj);
+echo "Clown\n";
+var_dump($copy);
+echo "Done\n";
+?>
+--EXPECT--
+Object
+object(test)#1 (3) {
+ ["p1"]=>
+ int(1)
+ ["p2"]=>
+ string(1) "A"
+ ["p3"]=>
+ string(1) "B"
+}
+Clown
+object(test)#2 (3) {
+ ["p1"]=>
+ int(1)
+ ["p2"]=>
+ string(1) "A"
+ ["p3"]=>
+ string(1) "C"
+}
+Done
diff --git a/tests/classes/clone_003.phpt b/tests/classes/clone_003.phpt
new file mode 100644
index 0000000..9a251c5
--- /dev/null
+++ b/tests/classes/clone_003.phpt
@@ -0,0 +1,58 @@
+--TEST--
+ZE2 object cloning, 3
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class base {
+ protected $p1 = 'base:1';
+ public $p2 = 'base:2';
+ public $p3 = 'base:3';
+ public $p4 = 'base:4';
+ public $p5 = 'base:5';
+ private $p6 = 'base:6';
+ public function __clone() {
+ }
+};
+
+class test extends base {
+ public $p1 = 'test:1';
+ public $p3 = 'test:3';
+ public $p4 = 'test:4';
+ public $p5 = 'test:5';
+ public function __clone() {
+ $this->p5 = 'clone:5';
+ }
+}
+
+$obj = new test;
+$obj->p4 = 'A';
+$copy = clone $obj;
+echo "Object\n";
+print_r($obj);
+echo "Clown\n";
+print_r($copy);
+echo "Done\n";
+?>
+--EXPECT--
+Object
+test Object
+(
+ [p1] => test:1
+ [p3] => test:3
+ [p4] => A
+ [p5] => test:5
+ [p2] => base:2
+ [p6:base:private] => base:6
+)
+Clown
+test Object
+(
+ [p1] => test:1
+ [p3] => test:3
+ [p4] => A
+ [p5] => clone:5
+ [p2] => base:2
+ [p6:base:private] => base:6
+)
+Done
diff --git a/tests/classes/clone_004.phpt b/tests/classes/clone_004.phpt
new file mode 100644
index 0000000..2059103
--- /dev/null
+++ b/tests/classes/clone_004.phpt
@@ -0,0 +1,82 @@
+--TEST--
+ZE2 object cloning, 4
+--FILE--
+<?php
+abstract class base {
+ public $a = 'base';
+
+ // disallow cloning
+ private function __clone() {}
+}
+
+class test extends base {
+ public $b = 'test';
+
+ // reenable cloning
+ public function __clone() {}
+
+ public function show() {
+ var_dump($this);
+ }
+}
+
+echo "Original\n";
+$o1 = new test;
+$o1->a = array(1,2);
+$o1->b = array(3,4);
+$o1->show();
+
+echo "Clone\n";
+$o2 = clone $o1;
+$o2->show();
+
+echo "Modify\n";
+$o2->a = 5;
+$o2->b = 6;
+$o2->show();
+
+echo "Done\n";
+?>
+--EXPECT--
+Original
+object(test)#1 (2) {
+ ["b"]=>
+ array(2) {
+ [0]=>
+ int(3)
+ [1]=>
+ int(4)
+ }
+ ["a"]=>
+ array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ }
+}
+Clone
+object(test)#2 (2) {
+ ["b"]=>
+ array(2) {
+ [0]=>
+ int(3)
+ [1]=>
+ int(4)
+ }
+ ["a"]=>
+ array(2) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ }
+}
+Modify
+object(test)#2 (2) {
+ ["b"]=>
+ int(6)
+ ["a"]=>
+ int(5)
+}
+Done
diff --git a/tests/classes/clone_005.phpt b/tests/classes/clone_005.phpt
new file mode 100644
index 0000000..bfe4d66
--- /dev/null
+++ b/tests/classes/clone_005.phpt
@@ -0,0 +1,19 @@
+--TEST--
+ZE2 object cloning, 5
+--FILE--
+<?php
+abstract class base {
+ public $a = 'base';
+
+ // disallow cloning once forever
+ final private function __clone() {}
+}
+
+class test extends base {
+ // reenabling should fail
+ public function __clone() {}
+}
+
+?>
+--EXPECTF--
+Fatal error: Cannot override final method base::__clone() in %sclone_005.php on line %d
diff --git a/tests/classes/clone_006.phpt b/tests/classes/clone_006.phpt
new file mode 100644
index 0000000..de22fec
--- /dev/null
+++ b/tests/classes/clone_006.phpt
@@ -0,0 +1,41 @@
+--TEST--
+ZE2 object cloning, 6
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--INI--
+error_reporting=2047
+--FILE--
+<?php
+
+class MyCloneable {
+ static $id = 0;
+
+ function MyCloneable() {
+ $this->id = self::$id++;
+ }
+
+ function __clone() {
+ $this->address = "New York";
+ $this->id = self::$id++;
+ }
+}
+
+$original = new MyCloneable();
+
+$original->name = "Hello";
+$original->address = "Tel-Aviv";
+
+echo $original->id . "\n";
+
+$clone = clone $original;
+
+echo $clone->id . "\n";
+echo $clone->name . "\n";
+echo $clone->address . "\n";
+
+?>
+--EXPECT--
+0
+1
+Hello
+New York
diff --git a/tests/classes/constants_basic_001.phpt b/tests/classes/constants_basic_001.phpt
new file mode 100644
index 0000000..74b0fcd
--- /dev/null
+++ b/tests/classes/constants_basic_001.phpt
@@ -0,0 +1,89 @@
+--TEST--
+Class constant declarations
+--FILE--
+<?php
+ define('DEFINED', 1234);
+ $def = 456;
+ define('DEFINED_TO_VAR', $def);
+ define('DEFINED_TO_UNDEF_VAR', $undef);
+
+ class C
+ {
+ const c0 = UNDEFINED;
+
+ const c1 = 1, c2 = 1.5;
+ const c3 = + 1, c4 = + 1.5;
+ const c5 = -1, c6 = -1.5;
+
+ const c7 = __LINE__;
+ const c8 = __FILE__;
+ const c9 = __CLASS__;
+ const c10 = __METHOD__;
+ const c11 = __FUNCTION__;
+
+ const c12 = DEFINED;
+ const c13 = DEFINED_TO_VAR;
+ const c14 = DEFINED_TO_UNDEF_VAR;
+
+ const c15 = "hello1";
+ const c16 = 'hello2';
+ const c17 = C::c16;
+ const c18 = self::c17;
+ }
+
+ echo "\nAttempt to access various kinds of class constants:\n";
+ var_dump(C::c0);
+ var_dump(C::c1);
+ var_dump(C::c2);
+ var_dump(C::c3);
+ var_dump(C::c4);
+ var_dump(C::c5);
+ var_dump(C::c6);
+ var_dump(C::c7);
+ var_dump(C::c8);
+ var_dump(C::c9);
+ var_dump(C::c10);
+ var_dump(C::c11);
+ var_dump(C::c12);
+ var_dump(C::c13);
+ var_dump(C::c14);
+ var_dump(C::c15);
+ var_dump(C::c16);
+ var_dump(C::c17);
+ var_dump(C::c18);
+
+ echo "\nExpecting fatal error:\n";
+ var_dump(C::c19);
+
+ echo "\nYou should not see this.";
+?>
+--EXPECTF--
+
+Notice: Undefined variable: undef in %s on line 5
+
+Attempt to access various kinds of class constants:
+
+Notice: Use of undefined constant UNDEFINED - assumed 'UNDEFINED' in %s on line %d
+string(9) "UNDEFINED"
+int(1)
+float(1.5)
+int(1)
+float(1.5)
+int(-1)
+float(-1.5)
+int(15)
+string(%d) "%s"
+string(1) "C"
+string(1) "C"
+string(0) ""
+int(1234)
+int(456)
+NULL
+string(6) "hello1"
+string(6) "hello2"
+string(6) "hello2"
+string(6) "hello2"
+
+Expecting fatal error:
+
+Fatal error: Undefined class constant 'c19' in %s on line 53
diff --git a/tests/classes/constants_basic_002.phpt b/tests/classes/constants_basic_002.phpt
new file mode 100644
index 0000000..0e53ca9
--- /dev/null
+++ b/tests/classes/constants_basic_002.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Basic class support - defining and reading a class constant.
+--FILE--
+<?php
+ class aclass
+ {
+ const myConst = "hello";
+ }
+
+ echo "\nRead class constant.\n";
+ var_dump(aclass::myConst);
+
+ echo "\nFail to read class constant from instance.\n";
+ $myInstance = new aclass();
+ var_dump($myInstance->myConst);
+
+ echo "\nClass constant not visible in object var_dump.\n";
+ var_dump($myInstance)
+?>
+--EXPECTF--
+
+Read class constant.
+string(5) "hello"
+
+Fail to read class constant from instance.
+
+Notice: Undefined property: aclass::$myConst in %s on line 12
+NULL
+
+Class constant not visible in object var_dump.
+object(aclass)#%d (0) {
+}
diff --git a/tests/classes/constants_basic_003.inc b/tests/classes/constants_basic_003.inc
new file mode 100644
index 0000000..be193e6
--- /dev/null
+++ b/tests/classes/constants_basic_003.inc
@@ -0,0 +1,5 @@
+<?php
+class A {
+ const MY_CONST = "hello from A";
+}
+?> \ No newline at end of file
diff --git a/tests/classes/constants_basic_003.phpt b/tests/classes/constants_basic_003.phpt
new file mode 100644
index 0000000..052af85
--- /dev/null
+++ b/tests/classes/constants_basic_003.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Ensure class properties and constants can be defined in terms of constants that are not known at compile time.
+--FILE--
+<?php
+ include 'constants_basic_003.inc';
+ class B
+ {
+ public static $a = A::MY_CONST;
+ public static $c = C::MY_CONST;
+ const ca = A::MY_CONST;
+ const cc = C::MY_CONST;
+ }
+
+ class C
+ {
+ const MY_CONST = "hello from C";
+ }
+
+ var_dump(B::$a);
+ var_dump(B::$c);
+ var_dump(B::ca);
+ var_dump(B::cc);
+?>
+--EXPECTF--
+string(12) "hello from A"
+string(12) "hello from C"
+string(12) "hello from A"
+string(12) "hello from C"
diff --git a/tests/classes/constants_basic_004.phpt b/tests/classes/constants_basic_004.phpt
new file mode 100644
index 0000000..cade668
--- /dev/null
+++ b/tests/classes/constants_basic_004.phpt
@@ -0,0 +1,99 @@
+--TEST--
+Test properties with array default values using class constants as keys and values.
+--FILE--
+<?php
+ class X
+ {
+ // Static and instance array using class constants
+ public static $sa_x = array(B::KEY => B::VALUE);
+ public $a_x = array(B::KEY => B::VALUE);
+ }
+
+ class B
+ {
+ const KEY = "key";
+ const VALUE = "value";
+
+ // Static and instance array using class constants with self
+ public static $sa_b = array(self::KEY => self::VALUE);
+ public $a_b = array(self::KEY => self::VALUE);
+ }
+
+ class C extends B
+ {
+ // Static and instance array using class constants with parent
+ public static $sa_c_parent = array(parent::KEY => parent::VALUE);
+ public $a_c_parent = array(parent::KEY => parent::VALUE);
+
+ // Static and instance array using class constants with self (constants should be inherited)
+ public static $sa_c_self = array(self::KEY => self::VALUE);
+ public $a_c_self = array(self::KEY => self::VALUE);
+
+ // Should also include inherited properties from B.
+ }
+
+ echo "\nStatic properties:\n";
+ var_dump(X::$sa_x, B::$sa_b, C::$sa_b, C::$sa_c_parent, C::$sa_c_self);
+
+ echo "\nInstance properties:\n";
+ $x = new x;
+ $b = new B;
+ $c = new C;
+ var_dump($x, $b, $c);
+?>
+--EXPECTF--
+
+Static properties:
+array(1) {
+ ["key"]=>
+ string(5) "value"
+}
+array(1) {
+ ["key"]=>
+ string(5) "value"
+}
+array(1) {
+ ["key"]=>
+ string(5) "value"
+}
+array(1) {
+ ["key"]=>
+ string(5) "value"
+}
+array(1) {
+ ["key"]=>
+ string(5) "value"
+}
+
+Instance properties:
+object(X)#%d (1) {
+ ["a_x"]=>
+ array(1) {
+ ["key"]=>
+ string(5) "value"
+ }
+}
+object(B)#%d (1) {
+ ["a_b"]=>
+ array(1) {
+ ["key"]=>
+ string(5) "value"
+ }
+}
+object(C)#%d (3) {
+ ["a_c_parent"]=>
+ array(1) {
+ ["key"]=>
+ string(5) "value"
+ }
+ ["a_c_self"]=>
+ array(1) {
+ ["key"]=>
+ string(5) "value"
+ }
+ ["a_b"]=>
+ array(1) {
+ ["key"]=>
+ string(5) "value"
+ }
+}
diff --git a/tests/classes/constants_basic_005.phpt b/tests/classes/constants_basic_005.phpt
new file mode 100644
index 0000000..c840f53
--- /dev/null
+++ b/tests/classes/constants_basic_005.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Test constants with default values based on other constants.
+--FILE--
+<?php
+ class C
+ {
+ const CONST_2 = self::CONST_1;
+ const CONST_1 = self::BASE_CONST;
+ const BASE_CONST = 'hello';
+ }
+ var_dump(C::CONST_1, C::CONST_2);
+?>
+--EXPECTF--
+string(5) "hello"
+string(5) "hello"
+
diff --git a/tests/classes/constants_basic_006.phpt b/tests/classes/constants_basic_006.phpt
new file mode 100644
index 0000000..73cf0ef
--- /dev/null
+++ b/tests/classes/constants_basic_006.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Ensure class constants are not evaluated when a class is looked up to resolve inheritance during runtime.
+--FILE--
+<?php
+ class C
+ {
+ const X = E::A;
+ public static $a = array(K => D::V, E::A => K);
+ }
+
+ eval('class D extends C { const V = \'test\'; }');
+
+ class E extends D
+ {
+ const A = "hello";
+ }
+
+ define('K', "nasty");
+
+ var_dump(C::X, C::$a, D::X, D::$a, E::X, E::$a);
+?>
+--EXPECTF--
+string(5) "hello"
+array(2) {
+ ["nasty"]=>
+ string(4) "test"
+ ["hello"]=>
+ string(5) "nasty"
+}
+string(5) "hello"
+array(2) {
+ ["nasty"]=>
+ string(4) "test"
+ ["hello"]=>
+ string(5) "nasty"
+}
+string(5) "hello"
+array(2) {
+ ["nasty"]=>
+ string(4) "test"
+ ["hello"]=>
+ string(5) "nasty"
+}
diff --git a/tests/classes/constants_error_001.phpt b/tests/classes/constants_error_001.phpt
new file mode 100644
index 0000000..9bb5533
--- /dev/null
+++ b/tests/classes/constants_error_001.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Error case: duplicate class constant definition
+--FILE--
+<?php
+ class myclass
+ {
+ const myConst = "hello";
+ const myConst = "hello again";
+ }
+?>
+--EXPECTF--
+
+Fatal error: Cannot redefine class constant myclass::myConst in %s on line 5
diff --git a/tests/classes/constants_error_002.phpt b/tests/classes/constants_error_002.phpt
new file mode 100644
index 0000000..be27971
--- /dev/null
+++ b/tests/classes/constants_error_002.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Error case: class constant as an array
+--FILE--
+<?php
+ class myclass
+ {
+ const myConst = array();
+ }
+?>
+--EXPECTF--
+
+Fatal error: Arrays are not allowed in class constants in %s on line 4
diff --git a/tests/classes/constants_error_003.phpt b/tests/classes/constants_error_003.phpt
new file mode 100644
index 0000000..c67768c
--- /dev/null
+++ b/tests/classes/constants_error_003.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Basic class support - attempting to pass a class constant by reference.
+--FILE--
+<?php
+ class aclass
+ {
+ const myConst = "hello";
+ }
+
+ function f(&$a)
+ {
+ $a = "changed";
+ }
+
+ f(aclass::myConst);
+ var_dump(aclass::myConst);
+?>
+--EXPECTF--
+
+Fatal error: Only variables can be passed by reference in %s on line 12
diff --git a/tests/classes/constants_error_004.phpt b/tests/classes/constants_error_004.phpt
new file mode 100644
index 0000000..03e6725
--- /dev/null
+++ b/tests/classes/constants_error_004.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Class constant whose initial value refereces a non-existent class
+--FILE--
+<?php
+ class C
+ {
+ const c1 = D::hello;
+ }
+
+ $a = new C();
+?>
+--EXPECTF--
+Fatal error: Class 'D' not found in %s on line %d
diff --git a/tests/classes/constants_error_005.phpt b/tests/classes/constants_error_005.phpt
new file mode 100644
index 0000000..1283783
--- /dev/null
+++ b/tests/classes/constants_error_005.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Error case: class constant as an encapsed containing a variable
+--FILE--
+<?php
+ class myclass
+ {
+ const myConst = "$myVar";
+ }
+?>
+--EXPECTF--
+
+Parse error: %s in %s on line %d
diff --git a/tests/classes/constants_error_006.phpt b/tests/classes/constants_error_006.phpt
new file mode 100644
index 0000000..f3f14b8
--- /dev/null
+++ b/tests/classes/constants_error_006.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Basic class support - attempting to modify a class constant by assignment
+--FILE--
+<?php
+ class aclass
+ {
+ const myConst = "hello";
+ }
+
+ echo "\nTrying to modify a class constant directly - should be parse error.\n";
+ aclass::myConst = "no!!";
+ var_dump(aclass::myConst);
+?>
+--EXPECTF--
+
+Parse error: %s in %s on line %d
diff --git a/tests/classes/constants_error_007.phpt b/tests/classes/constants_error_007.phpt
new file mode 100644
index 0000000..4be8d88
--- /dev/null
+++ b/tests/classes/constants_error_007.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Basic class support - attempting to create a reference to a class constant
+--FILE--
+<?php
+ class aclass
+ {
+ const myConst = "hello";
+ }
+
+ echo "\nAttempting to create a reference to a class constant - should be parse error.\n";
+ $a = &aclass::myConst;
+?>
+--EXPECTF--
+
+Parse error: %s in %s on line %d
diff --git a/tests/classes/constants_scope_001.phpt b/tests/classes/constants_scope_001.phpt
new file mode 100644
index 0000000..5006628
--- /dev/null
+++ b/tests/classes/constants_scope_001.phpt
@@ -0,0 +1,38 @@
+--TEST--
+ZE2 class constants and scope
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class ErrorCodes {
+ const FATAL = "Fatal error\n";
+ const WARNING = "Warning\n";
+ const INFO = "Informational message\n";
+
+ static function print_fatal_error_codes() {
+ echo "FATAL = " . FATAL . "\n";
+ echo "self::FATAL = " . self::FATAL;
+ }
+}
+
+class ErrorCodesDerived extends ErrorCodes {
+ const FATAL = "Worst error\n";
+ static function print_fatal_error_codes() {
+ echo "self::FATAL = " . self::FATAL;
+ echo "parent::FATAL = " . parent::FATAL;
+ }
+}
+
+/* Call the static function and move into the ErrorCodes scope */
+ErrorCodes::print_fatal_error_codes();
+ErrorCodesDerived::print_fatal_error_codes();
+
+?>
+--EXPECTF--
+
+Notice: Use of undefined constant FATAL - assumed 'FATAL' in %sconstants_scope_001.php on line %d
+FATAL = FATAL
+self::FATAL = Fatal error
+self::FATAL = Worst error
+parent::FATAL = Fatal error
diff --git a/tests/classes/ctor_dtor.phpt b/tests/classes/ctor_dtor.phpt
new file mode 100644
index 0000000..ea6813c
--- /dev/null
+++ b/tests/classes/ctor_dtor.phpt
@@ -0,0 +1,40 @@
+--TEST--
+ZE2 The new constructor/destructor is called
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class early {
+ function early() {
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ }
+ function __destruct() {
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ }
+}
+
+class late {
+ function __construct() {
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ }
+ function __destruct() {
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ }
+}
+
+$t = new early();
+$t->early();
+unset($t);
+$t = new late();
+//unset($t); delay to end of script
+
+echo "Done\n";
+?>
+--EXPECTF--
+early::early
+early::early
+early::__destruct
+late::__construct
+Done
+late::__destruct
diff --git a/tests/classes/ctor_dtor_inheritance.phpt b/tests/classes/ctor_dtor_inheritance.phpt
new file mode 100644
index 0000000..8ae2a5d
--- /dev/null
+++ b/tests/classes/ctor_dtor_inheritance.phpt
@@ -0,0 +1,99 @@
+--TEST--
+ZE2 A derived class can use the inherited constructor/destructor
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+// This test checks for:
+// - inherited constructors/destructors are not called automatically
+// - base classes know about derived properties in constructor/destructor
+// - base class constructors/destructors know the instanciated class name
+
+class base {
+ public $name;
+
+ function __construct() {
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ $this->name = 'base';
+ print_r($this);
+ }
+
+ function __destruct() {
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ print_r($this);
+ }
+}
+
+class derived extends base {
+ public $other;
+
+ function __construct() {
+ $this->name = 'init';
+ $this->other = 'other';
+ print_r($this);
+ parent::__construct();
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ $this->name = 'derived';
+ print_r($this);
+ }
+
+ function __destruct() {
+ parent::__destruct();
+ echo __CLASS__ . "::" . __FUNCTION__ . "\n";
+ print_r($this);
+ }
+}
+
+echo "Testing class base\n";
+$t = new base();
+unset($t);
+echo "Testing class derived\n";
+$t = new derived();
+unset($t);
+
+echo "Done\n";
+?>
+--EXPECTF--
+Testing class base
+base::__construct
+base Object
+(
+ [name] => base
+)
+base::__destruct
+base Object
+(
+ [name] => base
+)
+Testing class derived
+derived Object
+(
+ [other] => other
+ [name] => init
+)
+base::__construct
+derived Object
+(
+ [other] => other
+ [name] => base
+)
+derived::__construct
+derived Object
+(
+ [other] => other
+ [name] => derived
+)
+base::__destruct
+derived Object
+(
+ [other] => other
+ [name] => derived
+)
+derived::__destruct
+derived Object
+(
+ [other] => other
+ [name] => derived
+)
+Done
diff --git a/tests/classes/ctor_failure.phpt b/tests/classes/ctor_failure.phpt
new file mode 100644
index 0000000..b7d3b64
--- /dev/null
+++ b/tests/classes/ctor_failure.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 Do not call destructors if constructor fails
+--FILE--
+<?php
+
+class Test
+{
+ function __construct($msg) {
+ echo __METHOD__ . "($msg)\n";
+ throw new Exception($msg);
+ }
+
+ function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+try
+{
+ $o = new Test('Hello');
+ unset($o);
+}
+catch (Exception $e)
+{
+ echo 'Caught ' . get_class($e) . '(' . $e->getMessage() . ")\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test::__construct(Hello)
+Caught Exception(Hello)
+===DONE===
diff --git a/tests/classes/ctor_in_interface_01.phpt b/tests/classes/ctor_in_interface_01.phpt
new file mode 100644
index 0000000..e5ad30e
--- /dev/null
+++ b/tests/classes/ctor_in_interface_01.phpt
@@ -0,0 +1,19 @@
+--TEST--
+ZE2 A class constructor must keep the signature of an interface
+--FILE--
+<?php
+interface constr
+{
+ function __construct();
+}
+
+class implem implements constr
+{
+ function __construct($a)
+ {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of implem::__construct() must be compatible with constr::__construct() in %s on line %d
diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt
new file mode 100644
index 0000000..08e6f36
--- /dev/null
+++ b/tests/classes/ctor_in_interface_02.phpt
@@ -0,0 +1,34 @@
+--TEST--
+ZE2 A class constructor must keep the signature of all interfaces
+--FILE--
+<?php
+interface constr1
+{
+ function __construct();
+}
+
+interface constr2 extends constr1
+{
+}
+
+class implem12 implements constr2
+{
+ function __construct()
+ {
+ }
+}
+
+interface constr3
+{
+ function __construct($a);
+}
+
+class implem13 implements constr1, constr3
+{
+ function __construct()
+ {
+ }
+}
+?>
+--EXPECTF--
+Fatal error: Declaration of implem13::__construct() must be compatible with constr3::__construct($a) in %s on line %d
diff --git a/tests/classes/ctor_in_interface_03.phpt b/tests/classes/ctor_in_interface_03.phpt
new file mode 100644
index 0000000..ac73331
--- /dev/null
+++ b/tests/classes/ctor_in_interface_03.phpt
@@ -0,0 +1,23 @@
+--TEST--
+ZE2 A class constructor must keep the signature of base class interfaces
+--FILE--
+<?php
+interface constr
+{
+ function __construct();
+}
+
+abstract class implem implements constr
+{
+}
+
+class derived extends implem
+{
+ function __construct($a)
+ {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d
diff --git a/tests/classes/ctor_in_interface_04.phpt b/tests/classes/ctor_in_interface_04.phpt
new file mode 100644
index 0000000..94be655
--- /dev/null
+++ b/tests/classes/ctor_in_interface_04.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 A class constructor must keep the signature of base class interfaces
+--FILE--
+<?php
+interface constr
+{
+ function __construct();
+}
+
+class implem implements constr
+{
+ function __construct()
+ {
+ }
+}
+
+class derived extends implem
+{
+ function __construct($a)
+ {
+ }
+}
+
+?>
+--EXPECTF--
+Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d
diff --git a/tests/classes/ctor_name_clash.phpt b/tests/classes/ctor_name_clash.phpt
new file mode 100644
index 0000000..1a1d6fa
--- /dev/null
+++ b/tests/classes/ctor_name_clash.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ZE2 The child class can re-use the parent class name for a function member
+--FILE--
+<?php
+class base {
+ function base() {
+ echo __CLASS__."::".__FUNCTION__."\n";
+ }
+}
+
+class derived extends base {
+ function base() {
+ echo __CLASS__."::".__FUNCTION__."\n";
+ }
+}
+
+$obj = new derived();
+$obj->base();
+?>
+--EXPECTF--
+base::base
+derived::base
diff --git a/tests/classes/ctor_visibility.phpt b/tests/classes/ctor_visibility.phpt
new file mode 100644
index 0000000..8d3b1c5
--- /dev/null
+++ b/tests/classes/ctor_visibility.phpt
@@ -0,0 +1,69 @@
+--TEST--
+ZE2 A private constructor cannot be called
+--FILE--
+<?php
+
+class Test
+{
+ function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+}
+
+class Derived extends Test
+{
+ function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ parent::__construct();
+ }
+
+ static function f()
+ {
+ new Derived;
+ }
+}
+
+Derived::f();
+
+class TestPriv
+{
+ private function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ }
+
+ static function f()
+ {
+ new TestPriv;
+ }
+}
+
+TestPriv::f();
+
+class DerivedPriv extends TestPriv
+{
+ function __construct()
+ {
+ echo __METHOD__ . "()\n";
+ parent::__construct();
+ }
+
+ static function f()
+ {
+ new DerivedPriv;
+ }
+}
+
+DerivedPriv::f();
+
+?>
+===DONE===
+--EXPECTF--
+Derived::__construct()
+Test::__construct()
+TestPriv::__construct()
+DerivedPriv::__construct()
+
+Fatal error: Cannot call private TestPriv::__construct() in %sctor_visibility.php on line %d
diff --git a/tests/classes/dereferencing_001.phpt b/tests/classes/dereferencing_001.phpt
new file mode 100644
index 0000000..dd2aba7
--- /dev/null
+++ b/tests/classes/dereferencing_001.phpt
@@ -0,0 +1,35 @@
+--TEST--
+ZE2 dereferencing of objects from methods
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Name {
+ function Name($_name) {
+ $this->name = $_name;
+ }
+
+ function display() {
+ echo $this->name . "\n";
+ }
+}
+
+class Person {
+ private $name;
+
+ function person($_name, $_address) {
+ $this->name = new Name($_name);
+ }
+
+ function getName() {
+ return $this->name;
+ }
+}
+
+$person = new Person("John", "New York");
+$person->getName()->display();
+
+?>
+--EXPECT--
+John
diff --git a/tests/classes/destructor_and_echo.phpt b/tests/classes/destructor_and_echo.phpt
new file mode 100644
index 0000000..0a25359
--- /dev/null
+++ b/tests/classes/destructor_and_echo.phpt
@@ -0,0 +1,24 @@
+--TEST--
+ZE2 Destructors and echo
+--FILE--
+<?php
+
+class Test
+{
+ function __construct() {
+ echo __METHOD__ . "\n";
+ }
+
+ function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+$o = new Test;
+
+?>
+===DONE===
+--EXPECT--
+Test::__construct
+===DONE===
+Test::__destruct
diff --git a/tests/classes/destructor_and_exceptions.phpt b/tests/classes/destructor_and_exceptions.phpt
new file mode 100644
index 0000000..8100c92
--- /dev/null
+++ b/tests/classes/destructor_and_exceptions.phpt
@@ -0,0 +1,60 @@
+--TEST--
+ZE2 catch exception thrown in destructor
+--FILE--
+<?php
+
+class FailClass
+{
+ public $fatal;
+
+ function __destruct()
+ {
+ echo __METHOD__ . "\n";
+ throw new exception("FailClass");
+ echo "Done: " . __METHOD__ . "\n";
+ }
+}
+
+try
+{
+ $a = new FailClass;
+ unset($a);
+}
+catch(Exception $e)
+{
+ echo "Caught: " . $e->getMessage() . "\n";
+}
+
+class FatalException extends Exception
+{
+ function __construct($what)
+ {
+ echo __METHOD__ . "\n";
+ $o = new FailClass;
+ unset($o);
+ echo "Done: " . __METHOD__ . "\n";
+ }
+}
+
+try
+{
+ throw new FatalException("Damn");
+}
+catch(Exception $e)
+{
+ echo "Caught Exception: " . $e->getMessage() . "\n";
+}
+catch(FatalException $e)
+{
+ echo "Caught FatalException: " . $e->getMessage() . "\n";
+}
+
+?>
+===DONE===
+--EXPECTF--
+FailClass::__destruct
+Caught: FailClass
+FatalException::__construct
+FailClass::__destruct
+Caught Exception: FailClass
+===DONE===
diff --git a/tests/classes/destructor_and_globals.phpt b/tests/classes/destructor_and_globals.phpt
new file mode 100644
index 0000000..9caf0f1
--- /dev/null
+++ b/tests/classes/destructor_and_globals.phpt
@@ -0,0 +1,56 @@
+--TEST--
+ZE2 accessing globals from destructor in shutdown
+--FILE--
+<?php
+$test_cnt = 0;
+$test_num = 0;
+
+function Show() {
+ global $test_cnt;
+ echo "Count: $test_cnt\n";
+}
+
+class counter {
+ protected $id;
+
+ public function __construct() {
+ global $test_cnt, $test_num;
+ $test_cnt++;
+ $this->id = $test_num++;
+ }
+
+ public function Show() {
+ echo 'Id: '.$this->id."\n";
+ }
+
+ // try protected here
+ public function __destruct() {
+ global $test_cnt;
+ $test_cnt--;
+ }
+
+ static public function destroy(&$obj) {
+ $obj = NULL;
+ }
+}
+Show();
+$obj1 = new counter;
+$obj1->Show();
+Show();
+$obj2 = new counter;
+$obj2->Show();
+Show();
+counter::destroy($obj1);
+Show();
+// or uncomment this line and it works
+//counter::destroy($obj2);
+echo "Done\n";
+?>
+--EXPECT--
+Count: 0
+Id: 0
+Count: 1
+Id: 1
+Count: 2
+Count: 1
+Done
diff --git a/tests/classes/destructor_and_references.phpt b/tests/classes/destructor_and_references.phpt
new file mode 100644
index 0000000..6b9b019
--- /dev/null
+++ b/tests/classes/destructor_and_references.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 Destructing and references
+--FILE--
+<?php
+
+class test1 {public $x;};
+class test2 {public $x;};
+class test3 {public $x;};
+class test4 {public $x;};
+
+$o1 = new test1;
+$o2 = new test2;
+$o3 = new test3;
+$o4 = new test4;
+
+$o3->x = &$o4;
+
+$r1 = &$o1;
+
+class once {}
+
+$o = new once;
+echo "Done\n";
+?>
+--EXPECT--
+Done
diff --git a/tests/classes/destructor_inheritance.phpt b/tests/classes/destructor_inheritance.phpt
new file mode 100644
index 0000000..b9a4665
--- /dev/null
+++ b/tests/classes/destructor_inheritance.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 The inherited destructor is called
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class base {
+ function __construct() {
+ echo __METHOD__ . "\n";
+ }
+
+ function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class derived extends base {
+}
+
+$obj = new derived;
+
+unset($obj);
+
+echo 'Done';
+?>
+--EXPECT--
+base::__construct
+base::__destruct
+Done \ No newline at end of file
diff --git a/tests/classes/destructor_visibility_001.phpt b/tests/classes/destructor_visibility_001.phpt
new file mode 100644
index 0000000..7674c51
--- /dev/null
+++ b/tests/classes/destructor_visibility_001.phpt
@@ -0,0 +1,24 @@
+--TEST--
+ZE2 Ensuring destructor visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Base {
+ private function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class Derived extends Base {
+}
+
+$obj = new Derived;
+
+unset($obj);
+
+?>
+===DONE===
+--EXPECTF--
+Fatal error: Call to private Derived::__destruct() from context '' in %sdestructor_visibility_001.php on line %d
diff --git a/tests/classes/destructor_visibility_002.phpt b/tests/classes/destructor_visibility_002.phpt
new file mode 100644
index 0000000..2cc8333
--- /dev/null
+++ b/tests/classes/destructor_visibility_002.phpt
@@ -0,0 +1,24 @@
+--TEST--
+ZE2 Ensuring destructor visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Base {
+ private function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class Derived extends Base {
+}
+
+$obj = new Derived;
+
+?>
+===DONE===
+--EXPECTF--
+===DONE===
+
+Warning: Call to private Derived::__destruct() from context '' during shutdown ignored in Unknown on line %d
diff --git a/tests/classes/destructor_visibility_003.phpt b/tests/classes/destructor_visibility_003.phpt
new file mode 100644
index 0000000..83e3efe
--- /dev/null
+++ b/tests/classes/destructor_visibility_003.phpt
@@ -0,0 +1,28 @@
+--TEST--
+ZE2 Ensuring destructor visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Base {
+ private function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class Derived extends Base {
+ public function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+$obj = new Derived;
+
+unset($obj); // Derived::__destruct is being called not Base::__destruct
+
+?>
+===DONE===
+--EXPECTF--
+Derived::__destruct
+===DONE===
diff --git a/tests/classes/factory_001.phpt b/tests/classes/factory_001.phpt
new file mode 100644
index 0000000..97b69c1
--- /dev/null
+++ b/tests/classes/factory_001.phpt
@@ -0,0 +1,35 @@
+--TEST--
+ZE2 factory objects
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Circle {
+ function draw() {
+ echo "Circle\n";
+ }
+}
+
+class Square {
+ function draw() {
+ print "Square\n";
+ }
+}
+
+function ShapeFactoryMethod($shape) {
+ switch ($shape) {
+ case "Circle":
+ return new Circle();
+ case "Square":
+ return new Square();
+ }
+}
+
+ShapeFactoryMethod("Circle")->draw();
+ShapeFactoryMethod("Square")->draw();
+
+?>
+--EXPECT--
+Circle
+Square
diff --git a/tests/classes/factory_and_singleton_001.phpt b/tests/classes/factory_and_singleton_001.phpt
new file mode 100644
index 0000000..70fa020
--- /dev/null
+++ b/tests/classes/factory_and_singleton_001.phpt
@@ -0,0 +1,101 @@
+--TEST--
+ZE2 factory and singleton, test 1
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+ protected $x;
+
+ static private $test = NULL;
+ static private $cnt = 0;
+
+ static function factory($x) {
+ if (test::$test) {
+ return test::$test;
+ } else {
+ test::$test = new test($x);
+ return test::$test;
+ }
+ }
+
+ protected function __construct($x) {
+ test::$cnt++;
+ $this->x = $x;
+ }
+
+ static function destroy() {
+ test::$test = NULL;
+ }
+
+ protected function __destruct() {
+ test::$cnt--;
+ }
+
+ public function get() {
+ return $this->x;
+ }
+
+ static public function getX() {
+ if (test::$test) {
+ return test::$test->x;
+ } else {
+ return NULL;
+ }
+ }
+
+ static public function count() {
+ return test::$cnt;
+ }
+}
+
+echo "Access static members\n";
+var_dump(test::getX());
+var_dump(test::count());
+
+echo "Create x and y\n";
+$x = test::factory(1);
+$y = test::factory(2);
+var_dump(test::getX());
+var_dump(test::count());
+var_dump($x->get());
+var_dump($y->get());
+
+echo "Destruct x\n";
+$x = NULL;
+var_dump(test::getX());
+var_dump(test::count());
+var_dump($y->get());
+
+echo "Destruct y\n";
+$y = NULL;
+var_dump(test::getX());
+var_dump(test::count());
+
+echo "Destruct static\n";
+test::destroy();
+var_dump(test::getX());
+var_dump(test::count());
+
+echo "Done\n";
+?>
+--EXPECT--
+Access static members
+NULL
+int(0)
+Create x and y
+int(1)
+int(1)
+int(1)
+int(1)
+Destruct x
+int(1)
+int(1)
+int(1)
+Destruct y
+int(1)
+int(1)
+Destruct static
+NULL
+int(0)
+Done
diff --git a/tests/classes/factory_and_singleton_002.phpt b/tests/classes/factory_and_singleton_002.phpt
new file mode 100644
index 0000000..3308a56
--- /dev/null
+++ b/tests/classes/factory_and_singleton_002.phpt
@@ -0,0 +1,100 @@
+--TEST--
+ZE2 factory and singleton, test 2
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+ protected $x;
+
+ static private $test = NULL;
+ static private $cnt = 0;
+
+ static function factory($x) {
+ if (test::$test) {
+ return test::$test;
+ } else {
+ test::$test = new test($x);
+ return test::$test;
+ }
+ }
+
+ protected function __construct($x) {
+ test::$cnt++;
+ $this->x = $x;
+ }
+
+ static function destroy() {
+ test::$test = NULL;
+ }
+
+ protected function __destruct() {
+ test::$cnt--;
+ }
+
+ public function get() {
+ return $this->x;
+ }
+
+ static public function getX() {
+ if (test::$test) {
+ return test::$test->x;
+ } else {
+ return NULL;
+ }
+ }
+
+ static public function count() {
+ return test::$cnt;
+ }
+}
+
+echo "Access static members\n";
+var_dump(test::getX());
+var_dump(test::count());
+
+echo "Create x and y\n";
+$x = test::factory(1);
+$y = test::factory(2);
+var_dump(test::getX());
+var_dump(test::count());
+var_dump($x->get());
+var_dump($y->get());
+
+echo "Destruct x\n";
+$x = NULL;
+var_dump(test::getX());
+var_dump(test::count());
+var_dump($y->get());
+
+echo "Destruct y\n";
+$y = NULL;
+var_dump(test::getX());
+var_dump(test::count());
+
+//echo "Destruct static\n";
+//test::destroy();
+//var_dump(test::getX());
+//var_dump(test::count());
+
+echo "Done\n";
+?>
+--EXPECT--
+Access static members
+NULL
+int(0)
+Create x and y
+int(1)
+int(1)
+int(1)
+int(1)
+Destruct x
+int(1)
+int(1)
+int(1)
+Destruct y
+int(1)
+int(1)
+Done
+
+Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0
diff --git a/tests/classes/factory_and_singleton_003.phpt b/tests/classes/factory_and_singleton_003.phpt
new file mode 100644
index 0000000..3d50a81
--- /dev/null
+++ b/tests/classes/factory_and_singleton_003.phpt
@@ -0,0 +1,18 @@
+--TEST--
+ZE2 factory and singleton, test 3
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ protected function __construct($x) {
+ }
+}
+
+$obj = new test;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to protected test::__construct() from invalid context in %s on line %d
diff --git a/tests/classes/factory_and_singleton_004.phpt b/tests/classes/factory_and_singleton_004.phpt
new file mode 100644
index 0000000..14edcb1
--- /dev/null
+++ b/tests/classes/factory_and_singleton_004.phpt
@@ -0,0 +1,18 @@
+--TEST--
+ZE2 factory and singleton, test 4
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ private function __construct($x) {
+ }
+}
+
+$obj = new test;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to private test::__construct() from invalid context in %s on line %d
diff --git a/tests/classes/factory_and_singleton_005.phpt b/tests/classes/factory_and_singleton_005.phpt
new file mode 100644
index 0000000..2cd7e5c
--- /dev/null
+++ b/tests/classes/factory_and_singleton_005.phpt
@@ -0,0 +1,19 @@
+--TEST--
+ZE2 factory and singleton, test 5
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ protected function __destruct() {
+ }
+}
+
+$obj = new test;
+$obj = NULL;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to protected test::__destruct() from context '' in %sfactory_and_singleton_005.php on line %d
diff --git a/tests/classes/factory_and_singleton_006.phpt b/tests/classes/factory_and_singleton_006.phpt
new file mode 100644
index 0000000..81cf714
--- /dev/null
+++ b/tests/classes/factory_and_singleton_006.phpt
@@ -0,0 +1,20 @@
+--TEST--
+ZE2 factory and singleton, test 6
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ private function __destruct() {
+ }
+}
+
+$obj = new test;
+$obj = NULL;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to private test::__destruct() from context '' in %sfactory_and_singleton_006.php on line %d
+
diff --git a/tests/classes/factory_and_singleton_007.phpt b/tests/classes/factory_and_singleton_007.phpt
new file mode 100644
index 0000000..4788dbf
--- /dev/null
+++ b/tests/classes/factory_and_singleton_007.phpt
@@ -0,0 +1,20 @@
+--TEST--
+ZE2 factory and singleton, test 7
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ protected function __clone() {
+ }
+}
+
+$obj = new test;
+$clone = clone $obj;
+$obj = NULL;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to protected test::__clone() from context '' %sfactory_and_singleton_007.php on line %d
diff --git a/tests/classes/factory_and_singleton_008.phpt b/tests/classes/factory_and_singleton_008.phpt
new file mode 100644
index 0000000..750b9db
--- /dev/null
+++ b/tests/classes/factory_and_singleton_008.phpt
@@ -0,0 +1,20 @@
+--TEST--
+ZE2 factory and singleton, test 8
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ private function __clone() {
+ }
+}
+
+$obj = new test;
+$clone = clone $obj;
+$obj = NULL;
+
+echo "Done\n";
+?>
+--EXPECTF--
+Fatal error: Call to private test::__clone() from context '' %sfactory_and_singleton_008.php on line %d
diff --git a/tests/classes/factory_and_singleton_009.phpt b/tests/classes/factory_and_singleton_009.phpt
new file mode 100644
index 0000000..acf792c
--- /dev/null
+++ b/tests/classes/factory_and_singleton_009.phpt
@@ -0,0 +1,21 @@
+--TEST--
+ZE2 factory and singleton, test 9
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ protected function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+$obj = new test;
+
+?>
+===DONE===
+--EXPECTF--
+===DONE===
+
+Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0
diff --git a/tests/classes/factory_and_singleton_010.phpt b/tests/classes/factory_and_singleton_010.phpt
new file mode 100644
index 0000000..0f5fb2d
--- /dev/null
+++ b/tests/classes/factory_and_singleton_010.phpt
@@ -0,0 +1,21 @@
+--TEST--
+ZE2 factory and singleton, test 10
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class test {
+
+ private function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+$obj = new test;
+
+?>
+===DONE===
+--EXPECTF--
+===DONE===
+
+Warning: Call to private test::__destruct() from context '' during shutdown ignored in Unknown on line 0
diff --git a/tests/classes/final.phpt b/tests/classes/final.phpt
new file mode 100644
index 0000000..b4e37a3
--- /dev/null
+++ b/tests/classes/final.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 A method may be redeclared final
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class first {
+ function show() {
+ echo "Call to function first::show()\n";
+ }
+}
+
+$t = new first();
+$t->show();
+
+class second extends first {
+ final function show() {
+ echo "Call to function second::show()\n";
+ }
+}
+
+$t2 = new second();
+$t2->show();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Call to function first::show()
+Call to function second::show()
+Done \ No newline at end of file
diff --git a/tests/classes/final_abstract.phpt b/tests/classes/final_abstract.phpt
new file mode 100644
index 0000000..426c852
--- /dev/null
+++ b/tests/classes/final_abstract.phpt
@@ -0,0 +1,16 @@
+--TEST--
+ZE2 A final method cannot be abstract
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class fail {
+ final abstract function show();
+}
+
+echo "Done\n"; // Shouldn't be displayed
+?>
+--EXPECTF--
+
+Fatal error: Cannot use the final modifier on an abstract class member in %s
diff --git a/tests/classes/final_ctor1.phpt b/tests/classes/final_ctor1.phpt
new file mode 100644
index 0000000..ebfa080
--- /dev/null
+++ b/tests/classes/final_ctor1.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 cannot override final __construct
+--FILE--
+<?php
+
+class Base
+{
+ public final function __construct()
+ {
+ }
+}
+
+class Works extends Base
+{
+}
+
+class Extended extends Base
+{
+ public function Extended()
+ {
+ }
+}
+
+ReflectionClass::export('Extended');
+
+?>
+--EXPECTF--
+
+Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d
diff --git a/tests/classes/final_ctor2.phpt b/tests/classes/final_ctor2.phpt
new file mode 100644
index 0000000..905337b
--- /dev/null
+++ b/tests/classes/final_ctor2.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 cannot override final old style ctor
+--FILE--
+<?php
+
+class Base
+{
+ public final function Base()
+ {
+ }
+}
+
+class Works extends Base
+{
+}
+
+class Extended extends Base
+{
+ public function __construct()
+ {
+ }
+}
+
+ReflectionClass::export('Extended');
+
+?>
+--EXPECTF--
+
+Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d
diff --git a/tests/classes/final_ctor3.phpt b/tests/classes/final_ctor3.phpt
new file mode 100644
index 0000000..3a61ecf
--- /dev/null
+++ b/tests/classes/final_ctor3.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Ensure implicit final inherited old-style constructor cannot be overridden.
+--FILE--
+<?php
+ class A {
+ final function A() { }
+ }
+ class B extends A {
+ function A() { }
+ }
+?>
+--EXPECTF--
+Fatal error: Cannot override final method A::A() in %s on line %d
diff --git a/tests/classes/final_redeclare.phpt b/tests/classes/final_redeclare.phpt
new file mode 100644
index 0000000..e8f2e6f
--- /dev/null
+++ b/tests/classes/final_redeclare.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ZE2 A final method may not be overwritten
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ final function show() {
+ echo "Call to function pass::show()\n";
+ }
+}
+
+$t = new pass();
+
+class fail extends pass {
+ function show() {
+ echo "Call to function fail::show()\n";
+ }
+}
+
+echo "Done\n"; // Shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Cannot override final method pass::show() in %s on line %d
diff --git a/tests/classes/implicit_instantiation_001.phpt b/tests/classes/implicit_instantiation_001.phpt
new file mode 100644
index 0000000..8d2f32d
--- /dev/null
+++ b/tests/classes/implicit_instantiation_001.phpt
@@ -0,0 +1,146 @@
+--TEST--
+Implicit object instantiation when accessing properties of non-object.
+--FILE--
+<?php
+class C {
+ // These values get implicitly converted to objects
+ public $boolFalse = false;
+ public $emptyString = '';
+ public $null = null;
+
+ // These values do not get implicitly converted to objects
+ public $boolTrue = true;
+ public $nonEmptyString = 'hello';
+ public $intZero = 0;
+}
+
+$c = new C;
+foreach($c as $name => $value) {
+ echo "\n\n---( \$c->$name )---";
+ echo "\n --> Attempting implicit conversion to object using increment...\n";
+ $c->$name->prop++;
+ $c->$name = $value; // reset value in case implicit conversion was successful
+
+ echo "\n --> Attempting implicit conversion to object using assignment...\n";
+ $c->$name->prop = "Implicit instantiation!";
+ $c->$name = $value; // reset value in case implicit conversion was successful
+
+ echo "\n --> Attempting implicit conversion to object using combined assignment...\n";
+ $c->$name->prop .= " Implicit instantiation!";
+}
+
+echo "\n\n\n --> Resulting object:";
+var_dump($c);
+
+?>
+--EXPECTF--
+
+
+---( $c->boolFalse )---
+ --> Attempting implicit conversion to object using increment...
+
+Warning: Creating default object from empty value in %s on line 18
+
+ --> Attempting implicit conversion to object using assignment...
+
+Warning: Creating default object from empty value in %s on line 22
+
+ --> Attempting implicit conversion to object using combined assignment...
+
+Warning: Creating default object from empty value in %s on line 26
+
+
+---( $c->emptyString )---
+ --> Attempting implicit conversion to object using increment...
+
+Warning: Creating default object from empty value in %s on line 18
+
+ --> Attempting implicit conversion to object using assignment...
+
+Warning: Creating default object from empty value in %s on line 22
+
+ --> Attempting implicit conversion to object using combined assignment...
+
+Warning: Creating default object from empty value in %s on line 26
+
+
+---( $c->null )---
+ --> Attempting implicit conversion to object using increment...
+
+Warning: Creating default object from empty value in %s on line 18
+
+ --> Attempting implicit conversion to object using assignment...
+
+Warning: Creating default object from empty value in %s on line 22
+
+ --> Attempting implicit conversion to object using combined assignment...
+
+Warning: Creating default object from empty value in %s on line 26
+
+
+---( $c->boolTrue )---
+ --> Attempting implicit conversion to object using increment...
+
+Warning: Attempt to %s property of non-object in %s on line 18
+
+ --> Attempting implicit conversion to object using assignment...
+
+Warning: Attempt to assign property of non-object in %s on line 22
+
+ --> Attempting implicit conversion to object using combined assignment...
+
+Warning: Attempt to assign property of non-object in %s on line 26
+
+
+---( $c->nonEmptyString )---
+ --> Attempting implicit conversion to object using increment...
+
+Warning: Attempt to %s property of non-object in %s on line 18
+
+ --> Attempting implicit conversion to object using assignment...
+
+Warning: Attempt to assign property of non-object in %s on line 22
+
+ --> Attempting implicit conversion to object using combined assignment...
+
+Warning: Attempt to assign property of non-object in %s on line 26
+
+
+---( $c->intZero )---
+ --> Attempting implicit conversion to object using increment...
+
+Warning: Attempt to %s property of non-object in %s on line 18
+
+ --> Attempting implicit conversion to object using assignment...
+
+Warning: Attempt to assign property of non-object in %s on line 22
+
+ --> Attempting implicit conversion to object using combined assignment...
+
+Warning: Attempt to assign property of non-object in %s on line 26
+
+
+
+ --> Resulting object:object(C)#%d (6) {
+ [%u|b%"boolFalse"]=>
+ object(stdClass)#%d (1) {
+ [%u|b%"prop"]=>
+ %unicode|string%(24) " Implicit instantiation!"
+ }
+ [%u|b%"emptyString"]=>
+ object(stdClass)#%d (1) {
+ [%u|b%"prop"]=>
+ %unicode|string%(24) " Implicit instantiation!"
+ }
+ [%u|b%"null"]=>
+ object(stdClass)#%d (1) {
+ [%u|b%"prop"]=>
+ %unicode|string%(24) " Implicit instantiation!"
+ }
+ [%u|b%"boolTrue"]=>
+ bool(true)
+ [%u|b%"nonEmptyString"]=>
+ %unicode|string%(5) "hello"
+ [%u|b%"intZero"]=>
+ int(0)
+} \ No newline at end of file
diff --git a/tests/classes/incdec_property_001.phpt b/tests/classes/incdec_property_001.phpt
new file mode 100644
index 0000000..97a24d3
--- /dev/null
+++ b/tests/classes/incdec_property_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 post increment/decrement property of overloaded object
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property == "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property == "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$obj->a++;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---
diff --git a/tests/classes/incdec_property_002.phpt b/tests/classes/incdec_property_002.phpt
new file mode 100644
index 0000000..c1d7dde
--- /dev/null
+++ b/tests/classes/incdec_property_002.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 post increment/decrement property of overloaded object with assignment
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property == "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property == "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$t1 = $obj->a++;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---
diff --git a/tests/classes/incdec_property_003.phpt b/tests/classes/incdec_property_003.phpt
new file mode 100644
index 0000000..1a92384
--- /dev/null
+++ b/tests/classes/incdec_property_003.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 pre increment/decrement property of overloaded object
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property == "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property == "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+++$obj->a;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---
diff --git a/tests/classes/incdec_property_004.phpt b/tests/classes/incdec_property_004.phpt
new file mode 100644
index 0000000..05e3b44
--- /dev/null
+++ b/tests/classes/incdec_property_004.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 pre increment/decrement property of overloaded object with assignment
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property == "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property == "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$t1 = ++$obj->a;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---
diff --git a/tests/classes/inheritance.phpt b/tests/classes/inheritance.phpt
new file mode 100644
index 0000000..070ad91
--- /dev/null
+++ b/tests/classes/inheritance.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Classes inheritance test
+--FILE--
+<?php
+
+/* Inheritance test. Pretty nifty if I do say so myself! */
+
+class foo {
+ public $a;
+ public $b;
+ function display() {
+ echo "This is class foo\n";
+ echo "a = ".$this->a."\n";
+ echo "b = ".$this->b."\n";
+ }
+ function mul() {
+ return $this->a*$this->b;
+ }
+};
+
+class bar extends foo {
+ public $c;
+ function display() { /* alternative display function for class bar */
+ echo "This is class bar\n";
+ echo "a = ".$this->a."\n";
+ echo "b = ".$this->b."\n";
+ echo "c = ".$this->c."\n";
+ }
+};
+
+
+$foo1 = new foo;
+$foo1->a = 2;
+$foo1->b = 5;
+$foo1->display();
+echo $foo1->mul()."\n";
+
+echo "-----\n";
+
+$bar1 = new bar;
+$bar1->a = 4;
+$bar1->b = 3;
+$bar1->c = 12;
+$bar1->display();
+echo $bar1->mul()."\n";
+--EXPECT--
+This is class foo
+a = 2
+b = 5
+10
+-----
+This is class bar
+a = 4
+b = 3
+c = 12
+12
diff --git a/tests/classes/inheritance_002.phpt b/tests/classes/inheritance_002.phpt
new file mode 100644
index 0000000..cca528e
--- /dev/null
+++ b/tests/classes/inheritance_002.phpt
@@ -0,0 +1,71 @@
+--TEST--
+ZE2 Constructor precedence
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class Base_php4 {
+ function Base_php4() {
+ var_dump('Base constructor');
+ }
+}
+
+class Child_php4 extends Base_php4 {
+ function Child_php4() {
+ var_dump('Child constructor');
+ parent::Base_php4();
+ }
+}
+
+class Base_php5 {
+ function __construct() {
+ var_dump('Base constructor');
+ }
+ }
+
+class Child_php5 extends Base_php5 {
+ function __construct() {
+ var_dump('Child constructor');
+ parent::__construct();
+ }
+ }
+
+class Child_mx1 extends Base_php4 {
+ function __construct() {
+ var_dump('Child constructor');
+ parent::Base_php4();
+ }
+}
+
+class Child_mx2 extends Base_php5 {
+ function Child_mx2() {
+ var_dump('Child constructor');
+ parent::__construct();
+ }
+}
+
+echo "### PHP 4 style\n";
+$c4= new Child_php4();
+
+echo "### PHP 5 style\n";
+$c5= new Child_php5();
+
+echo "### Mixed style 1\n";
+$cm= new Child_mx1();
+
+echo "### Mixed style 2\n";
+$cm= new Child_mx2();
+?>
+--EXPECT--
+### PHP 4 style
+string(17) "Child constructor"
+string(16) "Base constructor"
+### PHP 5 style
+string(17) "Child constructor"
+string(16) "Base constructor"
+### Mixed style 1
+string(17) "Child constructor"
+string(16) "Base constructor"
+### Mixed style 2
+string(17) "Child constructor"
+string(16) "Base constructor"
diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt
new file mode 100644
index 0000000..1f4eafa
--- /dev/null
+++ b/tests/classes/inheritance_003.phpt
@@ -0,0 +1,21 @@
+--TEST--
+ZE2 method inheritance without interfaces
+--FILE--
+<?php
+
+class A
+{
+ function f($x) {}
+}
+
+class B extends A
+{
+ function f() {}
+}
+
+?>
+===DONE===
+--EXPECTF--
+
+Strict Standards: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d
+===DONE===
diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt
new file mode 100644
index 0000000..d1f5faf
--- /dev/null
+++ b/tests/classes/inheritance_004.phpt
@@ -0,0 +1,21 @@
+--TEST--
+ZE2 method inheritance without interfaces
+--FILE--
+<?php
+
+class A
+{
+ function f() {}
+}
+
+class B extends A
+{
+ function f($x) {}
+}
+
+?>
+===DONE===
+--EXPECTF--
+
+Strict Standards: Declaration of B::f() should be compatible with A::f() in %sinheritance_004.php on line %d
+===DONE===
diff --git a/tests/classes/inheritance_005.phpt b/tests/classes/inheritance_005.phpt
new file mode 100644
index 0000000..8990264
--- /dev/null
+++ b/tests/classes/inheritance_005.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Check for inherited old-style constructor.
+--FILE--
+<?php
+ class A
+ {
+ function A()
+ {
+ echo "In " . __METHOD__ . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ }
+
+ class C extends B
+ {
+ }
+
+
+ echo "About to construct new B: \n";
+ $b = new B;
+
+ echo "Is B::B() callable?\n";
+ var_dump(is_callable(array($b, "B")));
+
+ echo "Is B::A() callable?\n";
+ var_dump(is_callable(array($b, "A")));
+
+ echo "About to construct new C: \n";
+ $c = new C;
+
+ echo "Is C::A() callable?\n";
+ var_dump(is_callable(array($c, "A")));
+
+ echo "Is C::B() callable?\n";
+ var_dump(is_callable(array($c, "B")));
+
+ echo "Is C::C() callable?\n";
+ var_dump(is_callable(array($c, "C")));
+?>
+--EXPECTF--
+About to construct new B:
+In A::A
+Is B::B() callable?
+bool(false)
+Is B::A() callable?
+bool(true)
+About to construct new C:
+In A::A
+Is C::A() callable?
+bool(true)
+Is C::B() callable?
+bool(false)
+Is C::C() callable?
+bool(false)
diff --git a/tests/classes/inheritance_006.phpt b/tests/classes/inheritance_006.phpt
new file mode 100644
index 0000000..d51dafe
--- /dev/null
+++ b/tests/classes/inheritance_006.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Private property inheritance check
+--FILE--
+<?php
+Class A {
+ private $c;
+}
+
+Class B extends A {
+ private $c;
+}
+
+Class C extends B {
+}
+
+var_dump(new C);
+?>
+--EXPECTF--
+object(C)#%d (2) {
+ [%u|b%"c":%u|b%"B":private]=>
+ NULL
+ [%u|b%"c":%u|b%"A":private]=>
+ NULL
+} \ No newline at end of file
diff --git a/tests/classes/inheritance_007.phpt b/tests/classes/inheritance_007.phpt
new file mode 100644
index 0000000..0b2bde0
--- /dev/null
+++ b/tests/classes/inheritance_007.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Ensure inherited old-style constructor doesn't block other methods
+--FILE--
+<?php
+class A {
+ public function B () { echo "In " . __METHOD__ . "\n"; }
+ public function A () { echo "In " . __METHOD__ . "\n"; }
+}
+class B extends A { }
+
+$rc = new ReflectionClass('B');
+var_dump($rc->getMethods());
+
+
+$b = new B();
+$b->a();
+$b->b();
+
+?>
+--EXPECTF--
+array(2) {
+ [0]=>
+ &object(ReflectionMethod)#%d (2) {
+ ["name"]=>
+ string(1) "B"
+ ["class"]=>
+ string(1) "A"
+ }
+ [1]=>
+ &object(ReflectionMethod)#%d (2) {
+ ["name"]=>
+ string(1) "A"
+ ["class"]=>
+ string(1) "A"
+ }
+}
+In A::A
+In A::A
+In A::B
diff --git a/tests/classes/interface_and_extends.phpt b/tests/classes/interface_and_extends.phpt
new file mode 100644
index 0000000..f9040ae
--- /dev/null
+++ b/tests/classes/interface_and_extends.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 a class cannot extend an interface
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface Test
+{
+ function show();
+}
+
+class Tester extends Test
+{
+ function show() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+$o = new Tester;
+$o->show();
+
+?>
+===DONE===
+--EXPECTF--
+Fatal error: Class Tester cannot extend from interface Test in %sinterface_and_extends.php on line %d
diff --git a/tests/classes/interface_class.phpt b/tests/classes/interface_class.phpt
new file mode 100644
index 0000000..22520de
--- /dev/null
+++ b/tests/classes/interface_class.phpt
@@ -0,0 +1,14 @@
+--TEST--
+ZE2 A class can only implement interfaces
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class base {
+}
+
+class derived implements base {
+}
+?>
+--EXPECTF--
+Fatal error: derived cannot implement base - it is not an interface in %s on line %d
diff --git a/tests/classes/interface_constant_inheritance_001.phpt b/tests/classes/interface_constant_inheritance_001.phpt
new file mode 100644
index 0000000..f982a4a
--- /dev/null
+++ b/tests/classes/interface_constant_inheritance_001.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Ensure an interface may not shadow an inherited constant.
+--FILE--
+<?php
+interface I1 {
+ const FOO = 10;
+}
+
+interface I2 extends I1 {
+ const FOO = 10;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+
+Fatal error: Cannot inherit previously-inherited or override constant FOO from interface I1 in %s on line 6
diff --git a/tests/classes/interface_constant_inheritance_002.phpt b/tests/classes/interface_constant_inheritance_002.phpt
new file mode 100644
index 0000000..af4ce69
--- /dev/null
+++ b/tests/classes/interface_constant_inheritance_002.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Ensure a class may not shadow a constant inherited from an interface.
+--FILE--
+<?php
+interface I {
+ const FOO = 10;
+}
+
+class C implements I {
+ const FOO = 10;
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+
+Fatal error: Cannot inherit previously-inherited or override constant FOO from interface I in %s on line 6
diff --git a/tests/classes/interface_constant_inheritance_003.phpt b/tests/classes/interface_constant_inheritance_003.phpt
new file mode 100644
index 0000000..6b4139b
--- /dev/null
+++ b/tests/classes/interface_constant_inheritance_003.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Ensure a class may not inherit two constants with the same name from two separate interfaces.
+--FILE--
+<?php
+interface I1 {
+ const FOO = 10;
+}
+
+interface I2 {
+ const FOO = 10;
+}
+
+class C implements I1,I2 {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+
+Fatal error: Cannot inherit previously-inherited or override constant FOO from interface I2 in %s on line 10
diff --git a/tests/classes/interface_constant_inheritance_004.phpt b/tests/classes/interface_constant_inheritance_004.phpt
new file mode 100644
index 0000000..f055929
--- /dev/null
+++ b/tests/classes/interface_constant_inheritance_004.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Ensure a class may implement two interfaces which include the same constant (due to inheritance).
+--FILE--
+<?php
+interface IA {
+ const FOO = 10;
+}
+
+interface IB extends IA {
+}
+
+class C implements IA, IB {
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/interface_doubled.phpt b/tests/classes/interface_doubled.phpt
new file mode 100644
index 0000000..e1dd31f
--- /dev/null
+++ b/tests/classes/interface_doubled.phpt
@@ -0,0 +1,201 @@
+--TEST--
+ZE2 An interface extends base interfaces
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface if_a {
+ function f_a();
+}
+
+interface if_b {
+ function f_b();
+}
+
+interface if_c extends if_a, if_b {
+ function f_c();
+}
+
+interface if_d extends if_a, if_b {
+ function f_d();
+}
+
+interface if_e {
+ function f_d();
+}
+
+interface if_f extends /*if_e,*/ if_a, if_b, if_c, if_d /*, if_e*/ {
+}
+
+class base {
+ function test($class) {
+ echo "is_a(" . get_class($this) . ", $class) ". (($this instanceof $class) ? "yes\n" : "no\n");
+ }
+}
+
+echo "class_a\n";
+
+class class_a extends base implements if_a {
+ function f_a() {}
+ function f_b() {}
+ function f_c() {}
+ function f_d() {}
+ function f_e() {}
+}
+
+$t = new class_a();
+echo $t->test('if_a');
+echo $t->test('if_b');
+echo $t->test('if_c');
+echo $t->test('if_d');
+echo $t->test('if_e');
+
+echo "class_b\n";
+
+class class_b extends base implements if_a, if_b {
+ function f_a() {}
+ function f_b() {}
+ function f_c() {}
+ function f_d() {}
+ function f_e() {}
+}
+
+$t = new class_b();
+echo $t->test('if_a');
+echo $t->test('if_b');
+echo $t->test('if_c');
+echo $t->test('if_d');
+echo $t->test('if_e');
+
+echo "class_c\n";
+
+class class_c extends base implements if_c {
+ function f_a() {}
+ function f_b() {}
+ function f_c() {}
+ function f_d() {}
+ function f_e() {}
+}
+
+$t = new class_c();
+echo $t->test('if_a');
+echo $t->test('if_b');
+echo $t->test('if_c');
+echo $t->test('if_d');
+echo $t->test('if_e');
+
+echo "class_d\n";
+
+class class_d extends base implements if_d{
+ function f_a() {}
+ function f_b() {}
+ function f_c() {}
+ function f_d() {}
+ function f_e() {}
+}
+
+$t = new class_d();
+echo $t->test('if_a');
+echo $t->test('if_b');
+echo $t->test('if_c');
+echo $t->test('if_d');
+echo $t->test('if_e');
+
+echo "class_e\n";
+
+class class_e extends base implements if_a, if_b, if_c, if_d {
+ function f_a() {}
+ function f_b() {}
+ function f_c() {}
+ function f_d() {}
+ function f_e() {}
+}
+
+$t = new class_e();
+echo $t->test('if_a');
+echo $t->test('if_b');
+echo $t->test('if_c');
+echo $t->test('if_d');
+echo $t->test('if_e');
+
+echo "class_f\n";
+
+class class_f extends base implements if_e {
+ function f_a() {}
+ function f_b() {}
+ function f_c() {}
+ function f_d() {}
+ function f_e() {}
+}
+
+$t = new class_f();
+echo $t->test('if_a');
+echo $t->test('if_b');
+echo $t->test('if_c');
+echo $t->test('if_d');
+echo $t->test('if_e');
+
+echo "class_g\n";
+
+class class_g extends base implements if_f {
+ function f_a() {}
+ function f_b() {}
+ function f_c() {}
+ function f_d() {}
+ function f_e() {}
+}
+
+$t = new class_g();
+echo $t->test('if_a');
+echo $t->test('if_b');
+echo $t->test('if_c');
+echo $t->test('if_d');
+echo $t->test('if_e');
+
+?>
+===DONE===
+--EXPECTF--
+class_a
+is_a(class_a, if_a) yes
+is_a(class_a, if_b) no
+is_a(class_a, if_c) no
+is_a(class_a, if_d) no
+is_a(class_a, if_e) no
+class_b
+is_a(class_b, if_a) yes
+is_a(class_b, if_b) yes
+is_a(class_b, if_c) no
+is_a(class_b, if_d) no
+is_a(class_b, if_e) no
+class_c
+is_a(class_c, if_a) yes
+is_a(class_c, if_b) yes
+is_a(class_c, if_c) yes
+is_a(class_c, if_d) no
+is_a(class_c, if_e) no
+class_d
+is_a(class_d, if_a) yes
+is_a(class_d, if_b) yes
+is_a(class_d, if_c) no
+is_a(class_d, if_d) yes
+is_a(class_d, if_e) no
+class_e
+is_a(class_e, if_a) yes
+is_a(class_e, if_b) yes
+is_a(class_e, if_c) yes
+is_a(class_e, if_d) yes
+is_a(class_e, if_e) no
+class_f
+is_a(class_f, if_a) no
+is_a(class_f, if_b) no
+is_a(class_f, if_c) no
+is_a(class_f, if_d) no
+is_a(class_f, if_e) yes
+class_g
+is_a(class_g, if_a) yes
+is_a(class_g, if_b) yes
+is_a(class_g, if_c) yes
+is_a(class_g, if_d) yes
+is_a(class_g, if_e) no
+===DONE===
diff --git a/tests/classes/interface_implemented.phpt b/tests/classes/interface_implemented.phpt
new file mode 100644
index 0000000..e33a4da
--- /dev/null
+++ b/tests/classes/interface_implemented.phpt
@@ -0,0 +1,103 @@
+--TEST--
+ZE2 An interface is inherited
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface if_a {
+ function f_a();
+}
+
+interface if_b extends if_a {
+ function f_b();
+}
+
+class base {
+ function _is_a($sub) {
+ echo 'is_a('.get_class($this).', '.$sub.') = '.(($this instanceof $sub) ? 'yes' : 'no')."\n";
+ }
+ function test() {
+ echo $this->_is_a('base');
+ echo $this->_is_a('derived_a');
+ echo $this->_is_a('derived_b');
+ echo $this->_is_a('derived_c');
+ echo $this->_is_a('derived_d');
+ echo $this->_is_a('if_a');
+ echo $this->_is_a('if_b');
+ echo "\n";
+ }
+}
+
+class derived_a extends base implements if_a {
+ function f_a() {}
+}
+
+class derived_b extends base implements if_a, if_b {
+ function f_a() {}
+ function f_b() {}
+}
+
+class derived_c extends derived_a implements if_b {
+ function f_b() {}
+}
+
+class derived_d extends derived_c {
+}
+
+$t = new base();
+$t->test();
+
+$t = new derived_a();
+$t->test();
+
+$t = new derived_b();
+$t->test();
+
+$t = new derived_c();
+$t->test();
+
+$t = new derived_d();
+$t->test();
+
+?>
+--EXPECTF--
+is_a(base, base) = yes
+is_a(base, derived_a) = no
+is_a(base, derived_b) = no
+is_a(base, derived_c) = no
+is_a(base, derived_d) = no
+is_a(base, if_a) = no
+is_a(base, if_b) = no
+
+is_a(derived_a, base) = yes
+is_a(derived_a, derived_a) = yes
+is_a(derived_a, derived_b) = no
+is_a(derived_a, derived_c) = no
+is_a(derived_a, derived_d) = no
+is_a(derived_a, if_a) = yes
+is_a(derived_a, if_b) = no
+
+is_a(derived_b, base) = yes
+is_a(derived_b, derived_a) = no
+is_a(derived_b, derived_b) = yes
+is_a(derived_b, derived_c) = no
+is_a(derived_b, derived_d) = no
+is_a(derived_b, if_a) = yes
+is_a(derived_b, if_b) = yes
+
+is_a(derived_c, base) = yes
+is_a(derived_c, derived_a) = yes
+is_a(derived_c, derived_b) = no
+is_a(derived_c, derived_c) = yes
+is_a(derived_c, derived_d) = no
+is_a(derived_c, if_a) = yes
+is_a(derived_c, if_b) = yes
+
+is_a(derived_d, base) = yes
+is_a(derived_d, derived_a) = yes
+is_a(derived_d, derived_b) = no
+is_a(derived_d, derived_c) = yes
+is_a(derived_d, derived_d) = yes
+is_a(derived_d, if_a) = yes
+is_a(derived_d, if_b) = yes
diff --git a/tests/classes/interface_instantiate.phpt b/tests/classes/interface_instantiate.phpt
new file mode 100644
index 0000000..61c4e6b
--- /dev/null
+++ b/tests/classes/interface_instantiate.phpt
@@ -0,0 +1,16 @@
+--TEST--
+ZE2 An interface cannot be instantiated
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface if_a {
+ function f_a();
+}
+
+$t = new if_a();
+
+?>
+--EXPECTF--
+Fatal error: Cannot instantiate interface if_a in %s on line %d
diff --git a/tests/classes/interface_member.phpt b/tests/classes/interface_member.phpt
new file mode 100644
index 0000000..329c072
--- /dev/null
+++ b/tests/classes/interface_member.phpt
@@ -0,0 +1,13 @@
+--TEST--
+ZE2 An interface cannot have properties
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface if_a {
+ public $member;
+}
+?>
+--EXPECTF--
+Fatal error: Interfaces may not include member variables in %s on line %d
diff --git a/tests/classes/interface_method.phpt b/tests/classes/interface_method.phpt
new file mode 100644
index 0000000..3570b35
--- /dev/null
+++ b/tests/classes/interface_method.phpt
@@ -0,0 +1,15 @@
+--TEST--
+ZE2 An interface method must be abstract
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface if_a {
+ function err() {};
+}
+
+?>
+--EXPECTF--
+
+Fatal error: Interface function if_a::err() cannot contain body %s on line %d
diff --git a/tests/classes/interface_method_final.phpt b/tests/classes/interface_method_final.phpt
new file mode 100644
index 0000000..01e599c
--- /dev/null
+++ b/tests/classes/interface_method_final.phpt
@@ -0,0 +1,15 @@
+--TEST--
+ZE2 An interface method cannot be final
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class if_a {
+ abstract final function err();
+}
+
+?>
+--EXPECTF--
+
+Fatal error: Cannot use the final modifier on an abstract class member in %s on line %d
diff --git a/tests/classes/interface_method_private.phpt b/tests/classes/interface_method_private.phpt
new file mode 100644
index 0000000..aa46a03
--- /dev/null
+++ b/tests/classes/interface_method_private.phpt
@@ -0,0 +1,15 @@
+--TEST--
+ZE2 An interface method cannot be private
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface if_a {
+ abstract private function err();
+}
+
+?>
+--EXPECTF--
+
+Fatal error: Access type for interface method if_a::err() must be omitted in %s on line %d
diff --git a/tests/classes/interface_must_be_implemented.phpt b/tests/classes/interface_must_be_implemented.phpt
new file mode 100644
index 0000000..a4d7970
--- /dev/null
+++ b/tests/classes/interface_must_be_implemented.phpt
@@ -0,0 +1,17 @@
+--TEST--
+ZE2 An interface must be implemented
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface if_a {
+ function f_a();
+}
+
+class derived_a implements if_a {
+}
+
+?>
+--EXPECTF--
+Fatal error: Class derived_a contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (if_a::f_a) in %s on line %d
diff --git a/tests/classes/interface_optional_arg.phpt b/tests/classes/interface_optional_arg.phpt
new file mode 100644
index 0000000..05f2fc4
--- /dev/null
+++ b/tests/classes/interface_optional_arg.phpt
@@ -0,0 +1,27 @@
+--TEST--
+ZE2 An interface method allows additional default arguments
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+error_reporting(4095);
+
+interface test {
+ public function bar();
+}
+
+class foo implements test {
+
+ public function bar($foo = NULL) {
+ echo "foo\n";
+ }
+}
+
+$foo = new foo;
+$foo->bar();
+
+?>
+--EXPECT--
+foo
+
diff --git a/tests/classes/interface_optional_arg_002.phpt b/tests/classes/interface_optional_arg_002.phpt
new file mode 100644
index 0000000..92980f6
--- /dev/null
+++ b/tests/classes/interface_optional_arg_002.phpt
@@ -0,0 +1,24 @@
+--TEST--
+default argument value in interface implementation
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface test {
+ public function bar();
+}
+
+class foo implements test {
+
+ public function bar($arg = 2) {
+ var_dump($arg);
+ }
+}
+
+$foo = new foo;
+$foo->bar();
+
+?>
+--EXPECT--
+int(2) \ No newline at end of file
diff --git a/tests/classes/interface_optional_arg_003.inc b/tests/classes/interface_optional_arg_003.inc
new file mode 100644
index 0000000..a62c656
--- /dev/null
+++ b/tests/classes/interface_optional_arg_003.inc
@@ -0,0 +1,4 @@
+<?php
+interface I {
+ function f($a = null);
+} \ No newline at end of file
diff --git a/tests/classes/interface_optional_arg_003.phpt b/tests/classes/interface_optional_arg_003.phpt
new file mode 100644
index 0000000..13e36d5
--- /dev/null
+++ b/tests/classes/interface_optional_arg_003.phpt
@@ -0,0 +1,17 @@
+--TEST--
+default argument value in and in implementing class with interface in included file
+--FILE--
+<?php
+include 'interface_optional_arg_003.inc';
+
+class C implements I {
+ function f($a = 2) {
+ var_dump($a);
+ }
+}
+
+$c = new C;
+$c->f();
+?>
+--EXPECTF--
+int(2) \ No newline at end of file
diff --git a/tests/classes/interfaces_001.phpt b/tests/classes/interfaces_001.phpt
new file mode 100644
index 0000000..41e1f67
--- /dev/null
+++ b/tests/classes/interfaces_001.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 interfaces
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface Throwable {
+ public function getMessage();
+}
+
+class Exception_foo implements Throwable {
+ public $foo = "foo";
+
+ public function getMessage() {
+ return $this->foo;
+ }
+}
+
+$foo = new Exception_foo;
+echo $foo->getMessage() . "\n";
+
+?>
+--EXPECT--
+foo
+
diff --git a/tests/classes/interfaces_002.phpt b/tests/classes/interfaces_002.phpt
new file mode 100644
index 0000000..d26b534
--- /dev/null
+++ b/tests/classes/interfaces_002.phpt
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 interface with an unimplemented method
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface Throwable {
+ public function getMessage();
+ public function getErrno();
+}
+
+class Exception_foo implements Throwable {
+ public $foo = "foo";
+
+ public function getMessage() {
+ return $this->foo;
+ }
+}
+
+// this should die -- Exception class must be abstract...
+$foo = new Exception_foo;
+echo "Message: " . $foo->getMessage() . "\n";
+
+?>
+===DONE===
+--EXPECTF--
+
+Fatal error: Class Exception_foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Throwable::getErrno) in %s on line %d
diff --git a/tests/classes/interfaces_003.phpt b/tests/classes/interfaces_003.phpt
new file mode 100644
index 0000000..f9ab92b
--- /dev/null
+++ b/tests/classes/interfaces_003.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 interface and __construct
+--FILE--
+<?php
+
+class MyObject {}
+
+interface MyInterface
+{
+ public function __construct(MyObject $o);
+}
+
+class MyTestClass implements MyInterface
+{
+ public function __construct(MyObject $o)
+ {
+ }
+}
+
+$obj = new MyTestClass;
+
+?>
+===DONE===
+--EXPECTF--
+
+Catchable fatal error: Argument 1 passed to MyTestClass::__construct() must be an instance of MyObject, none given, called in %sinterfaces_003.php on line %d
diff --git a/tests/classes/iterators_001.phpt b/tests/classes/iterators_001.phpt
new file mode 100644
index 0000000..02e3610
--- /dev/null
+++ b/tests/classes/iterators_001.phpt
@@ -0,0 +1,200 @@
+--TEST--
+ZE2 iterators and foreach
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class c_iter implements Iterator {
+
+ private $obj;
+ private $num = 0;
+
+ function __construct($obj) {
+ echo __METHOD__ . "\n";
+ $this->num = 0;
+ $this->obj = $obj;
+ }
+ function rewind() {
+ }
+ function valid() {
+ $more = $this->num < $this->obj->max;
+ echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
+ return $more;
+ }
+ function current() {
+ echo __METHOD__ . "\n";
+ return $this->num;
+ }
+ function next() {
+ echo __METHOD__ . "\n";
+ $this->num++;
+ }
+ function key() {
+ echo __METHOD__ . "\n";
+ switch($this->num) {
+ case 0: return "1st";
+ case 1: return "2nd";
+ case 2: return "3rd";
+ default: return "???";
+ }
+ }
+}
+
+class c implements IteratorAggregate {
+
+ public $max = 3;
+
+ function getIterator() {
+ echo __METHOD__ . "\n";
+ return new c_iter($this);
+ }
+}
+
+echo "===Array===\n";
+
+$a = array(0,1,2);
+foreach($a as $v) {
+ echo "array:$v\n";
+}
+
+echo "===Manual===\n";
+$t = new c();
+for ($iter = $t->getIterator(); $iter->valid(); $iter->next()) {
+ echo $iter->current() . "\n";
+}
+
+echo "===foreach/std===\n";
+foreach($t as $v) {
+ echo "object:$v\n";
+}
+
+echo "===foreach/rec===\n";
+foreach($t as $v) {
+ foreach($t as $w) {
+ echo "double:$v:$w\n";
+ }
+}
+
+echo "===foreach/key===\n";
+foreach($t as $i => $v) {
+ echo "object:$i=>$v\n";
+}
+
+print "Done\n";
+exit(0);
+?>
+--EXPECT--
+===Array===
+array:0
+array:1
+array:2
+===Manual===
+c::getIterator
+c_iter::__construct
+c_iter::valid = true
+c_iter::current
+0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+1
+c_iter::next
+c_iter::valid = true
+c_iter::current
+2
+c_iter::next
+c_iter::valid = false
+===foreach/std===
+c::getIterator
+c_iter::__construct
+c_iter::valid = true
+c_iter::current
+object:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+object:1
+c_iter::next
+c_iter::valid = true
+c_iter::current
+object:2
+c_iter::next
+c_iter::valid = false
+===foreach/rec===
+c::getIterator
+c_iter::__construct
+c_iter::valid = true
+c_iter::current
+c::getIterator
+c_iter::__construct
+c_iter::valid = true
+c_iter::current
+double:0:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+double:0:1
+c_iter::next
+c_iter::valid = true
+c_iter::current
+double:0:2
+c_iter::next
+c_iter::valid = false
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c::getIterator
+c_iter::__construct
+c_iter::valid = true
+c_iter::current
+double:1:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+double:1:1
+c_iter::next
+c_iter::valid = true
+c_iter::current
+double:1:2
+c_iter::next
+c_iter::valid = false
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c::getIterator
+c_iter::__construct
+c_iter::valid = true
+c_iter::current
+double:2:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+double:2:1
+c_iter::next
+c_iter::valid = true
+c_iter::current
+double:2:2
+c_iter::next
+c_iter::valid = false
+c_iter::next
+c_iter::valid = false
+===foreach/key===
+c::getIterator
+c_iter::__construct
+c_iter::valid = true
+c_iter::current
+c_iter::key
+object:1st=>0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c_iter::key
+object:2nd=>1
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c_iter::key
+object:3rd=>2
+c_iter::next
+c_iter::valid = false
+Done
diff --git a/tests/classes/iterators_002.phpt b/tests/classes/iterators_002.phpt
new file mode 100644
index 0000000..4a58be0
--- /dev/null
+++ b/tests/classes/iterators_002.phpt
@@ -0,0 +1,113 @@
+--TEST--
+ZE2 iterators and break
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class c_iter implements Iterator {
+
+ private $obj;
+ private $num = 0;
+
+ function __construct($obj) {
+ echo __METHOD__ . "\n";
+ $this->obj = $obj;
+ }
+ function rewind() {
+ echo __METHOD__ . "\n";
+ $this->num = 0;
+ }
+ function valid() {
+ $more = $this->num < $this->obj->max;
+ echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
+ return $more;
+ }
+ function current() {
+ echo __METHOD__ . "\n";
+ return $this->num;
+ }
+ function next() {
+ echo __METHOD__ . "\n";
+ $this->num++;
+ }
+ function key() {
+ echo __METHOD__ . "\n";
+ switch($this->num) {
+ case 0: return "1st";
+ case 1: return "2nd";
+ case 2: return "3rd";
+ default: return "???";
+ }
+ }
+ function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+class c implements IteratorAggregate {
+
+ public $max = 3;
+
+ function getIterator() {
+ echo __METHOD__ . "\n";
+ return new c_iter($this);
+ }
+ function __destruct() {
+ echo __METHOD__ . "\n";
+ }
+}
+
+$t = new c();
+
+foreach($t as $k => $v) {
+ foreach($t as $w) {
+ echo "double:$v:$w\n";
+ break;
+ }
+}
+
+unset($t);
+
+print "Done\n";
+?>
+--EXPECT--
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+c_iter::key
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:0:0
+c_iter::__destruct
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c_iter::key
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:1:0
+c_iter::__destruct
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c_iter::key
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:2:0
+c_iter::__destruct
+c_iter::next
+c_iter::valid = false
+c_iter::__destruct
+c::__destruct
+Done
diff --git a/tests/classes/iterators_003.phpt b/tests/classes/iterators_003.phpt
new file mode 100644
index 0000000..42695db
--- /dev/null
+++ b/tests/classes/iterators_003.phpt
@@ -0,0 +1,115 @@
+--TEST--
+ZE2 iterators and break
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class c_iter implements Iterator {
+
+ private $obj;
+ private $num = 0;
+
+ function __construct($obj) {
+ echo __METHOD__ . "\n";
+ $this->obj = $obj;
+ }
+ function rewind() {
+ echo __METHOD__ . "\n";
+ }
+ function valid() {
+ $more = $this->num < $this->obj->max;
+ echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
+ return $more;
+ }
+ function current() {
+ echo __METHOD__ . "\n";
+ return $this->num;
+ }
+ function next() {
+ echo __METHOD__ . "\n";
+ $this->num++;
+ }
+ function key() {
+ return $this->num;
+ }
+}
+
+class c implements IteratorAggregate {
+
+ public $max = 4;
+
+ function getIterator() {
+ echo __METHOD__ . "\n";
+ return new c_iter($this);
+ }
+}
+
+$t = new c();
+
+foreach($t as $v) {
+ if ($v == 0) {
+ echo "continue outer\n";
+ continue;
+ }
+ foreach($t as $w) {
+ if ($w == 1) {
+ echo "continue inner\n";
+ continue;
+ }
+ if ($w == 2) {
+ echo "break inner\n";
+ break;
+ }
+ echo "double:$v:$w\n";
+ }
+ if ($v == 2) {
+ echo "break outer\n";
+ break;
+ }
+}
+
+print "Done\n";
+?>
+--EXPECT--
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+continue outer
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:1:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+continue inner
+c_iter::next
+c_iter::valid = true
+c_iter::current
+break inner
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:2:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+continue inner
+c_iter::next
+c_iter::valid = true
+c_iter::current
+break inner
+break outer
+Done
diff --git a/tests/classes/iterators_004.phpt b/tests/classes/iterators_004.phpt
new file mode 100644
index 0000000..3fe0527
--- /dev/null
+++ b/tests/classes/iterators_004.phpt
@@ -0,0 +1,61 @@
+--TEST--
+ZE2 iterators must be implemented
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+echo "1st try\n";
+
+class c1 {}
+
+$obj = new c1();
+
+foreach($obj as $w) {
+ echo "object:$w\n";
+}
+
+echo "2nd try\n";
+
+class c2 {
+
+ public $max = 3;
+ public $num = 0;
+
+ function current() {
+ echo __METHOD__ . "\n";
+ return $this->num;
+ }
+ function next() {
+ echo __METHOD__ . "\n";
+ $this->num++;
+ }
+ function valid() {
+ echo __METHOD__ . "\n";
+ return $this->num < $this->max;
+ }
+ function key() {
+ echo __METHOD__ . "\n";
+ switch($this->num) {
+ case 0: return "1st";
+ case 1: return "2nd";
+ case 2: return "3rd";
+ default: return "???";
+ }
+ }
+}
+
+$obj = new c2();
+
+foreach($obj as $v => $w) {
+ echo "object:$v=>$w\n";
+}
+
+print "Done\n";
+?>
+--EXPECTF--
+1st try
+2nd try
+object:max=>3
+object:num=>0
+Done
diff --git a/tests/classes/iterators_005.phpt b/tests/classes/iterators_005.phpt
new file mode 100644
index 0000000..005deb9
--- /dev/null
+++ b/tests/classes/iterators_005.phpt
@@ -0,0 +1,19 @@
+--TEST--
+ZE2 iterators cannot implement Traversable alone
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class test implements Traversable {
+}
+
+$obj = new test;
+
+foreach($obj as $v);
+
+print "Done\n";
+/* the error doesn't show the filename but 'Unknown' */
+?>
+--EXPECTF--
+Fatal error: Class test must implement interface Traversable as part of either Iterator or IteratorAggregate in %s on line %d
diff --git a/tests/classes/iterators_006.phpt b/tests/classes/iterators_006.phpt
new file mode 100644
index 0000000..47fa690
--- /dev/null
+++ b/tests/classes/iterators_006.phpt
@@ -0,0 +1,87 @@
+--TEST--
+ZE2 iterators and array wrapping
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 is needed'); ?>
+--FILE--
+<?php
+
+class ai implements Iterator {
+
+ private $array;
+
+ function __construct() {
+ $this->array = array('foo', 'bar', 'baz');
+ }
+
+ function rewind() {
+ reset($this->array);
+ $this->next();
+ }
+
+ function valid() {
+ return $this->key !== NULL;
+ }
+
+ function key() {
+ return $this->key;
+ }
+
+ function current() {
+ return $this->current;
+ }
+
+ function next() {
+ list($this->key, $this->current) = each($this->array);
+// list($key, $current) = each($this->array);
+// $this->key = $key;
+// $this->current = $current;
+ }
+}
+
+class a implements IteratorAggregate {
+
+ public function getIterator() {
+ return new ai();
+ }
+}
+
+$array = new a();
+
+foreach ($array as $property => $value) {
+ print "$property: $value\n";
+}
+
+#$array = $array->getIterator();
+#$array->rewind();
+#$array->valid();
+#var_dump($array->key());
+#var_dump($array->current());
+echo "===2nd===\n";
+
+$array = new ai();
+
+foreach ($array as $property => $value) {
+ print "$property: $value\n";
+}
+
+echo "===3rd===\n";
+
+foreach ($array as $property => $value) {
+ print "$property: $value\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+0: foo
+1: bar
+2: baz
+===2nd===
+0: foo
+1: bar
+2: baz
+===3rd===
+0: foo
+1: bar
+2: baz
+===DONE=== \ No newline at end of file
diff --git a/tests/classes/iterators_007.phpt b/tests/classes/iterators_007.phpt
new file mode 100644
index 0000000..f2638b3
--- /dev/null
+++ b/tests/classes/iterators_007.phpt
@@ -0,0 +1,43 @@
+--TEST--
+ZE2 iterators and exceptions
+--FILE--
+<?php
+class Test implements Iterator
+{
+ public $arr = array(1, 2, 3);
+ public $x = 0;
+
+ public function rewind() { if ($this->x == 0) throw new Exception(__METHOD__); reset($this->arr); }
+ public function current() { if ($this->x == 1) throw new Exception(__METHOD__); return current($this->arr); }
+ public function key() { if ($this->x == 2) throw new Exception(__METHOD__); return key($this->arr); }
+ public function next() { if ($this->x == 3) throw new Exception(__METHOD__); next($this->arr); }
+ public function valid() { if ($this->x == 4) throw new Exception(__METHOD__); return (key($this->arr) !== NULL); }
+}
+
+$t = new Test();
+
+while($t->x < 5)
+{
+ try
+ {
+ foreach($t as $k => $v)
+ {
+ echo "Current\n";
+ }
+ }
+ catch(Exception $e)
+ {
+ echo "Caught in " . $e->getMessage() . "()\n";
+ }
+ $t->x++;
+}
+?>
+===DONE===
+--EXPECT--
+Caught in Test::rewind()
+Caught in Test::current()
+Caught in Test::key()
+Current
+Caught in Test::next()
+Caught in Test::valid()
+===DONE===
diff --git a/tests/classes/iterators_008.phpt b/tests/classes/iterators_008.phpt
new file mode 100644
index 0000000..22e6dc8
--- /dev/null
+++ b/tests/classes/iterators_008.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Ensure plain userspace superclass does not override special iterator behaviour on child class.
+--FILE--
+<?php
+Class C {}
+
+class D extends C implements Iterator {
+
+ private $counter = 2;
+
+ public function valid() {
+ echo __METHOD__ . "($this->counter)\n";
+ return $this->counter;
+ }
+
+ public function next() {
+ $this->counter--;
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+ public function rewind() {
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+ public function current() {
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+ public function key() {
+ echo __METHOD__ . "($this->counter)\n";
+ }
+
+}
+
+foreach (new D as $x) {}
+?>
+--EXPECTF--
+D::rewind(2)
+D::valid(2)
+D::current(2)
+D::next(1)
+D::valid(1)
+D::current(1)
+D::next(0)
+D::valid(0) \ No newline at end of file
diff --git a/tests/classes/method_call_variation_001.phpt b/tests/classes/method_call_variation_001.phpt
new file mode 100644
index 0000000..dd43cfd
--- /dev/null
+++ b/tests/classes/method_call_variation_001.phpt
@@ -0,0 +1,37 @@
+--TEST--
+In $a->$b[Y](), $b[Y] represents a method name on $a. But in $a->X[Y](), $a->X[Y] represents a global function name.
+--FILE--
+<?php
+ class C
+ {
+ function foo($a, $b)
+ {
+ echo "Called C::foo($a, $b)\n";
+ }
+ }
+
+ $c = new C;
+
+ $functions[0] = 'foo';
+ $functions[1][2][3][4] = 'foo';
+
+ $c->$functions[0](1, 2);
+ $c->$functions[1][2][3][4](3, 4);
+
+
+ function foo($a, $b)
+ {
+ echo "Called global foo($a, $b)\n";
+ }
+
+ $c->functions[0] = 'foo';
+ $c->functions[1][2][3][4] = 'foo';
+
+ $c->functions[0](5, 6);
+ $c->functions[1][2][3][4](7, 8);
+?>
+--EXPECTF--
+Called C::foo(1, 2)
+Called C::foo(3, 4)
+Called global foo(5, 6)
+Called global foo(7, 8)
diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt
new file mode 100644
index 0000000..333c29d
--- /dev/null
+++ b/tests/classes/method_override_optional_arg_001.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Method override allows optional default argument
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class A {
+ function foo($arg1 = 1) {
+ }
+}
+
+class B extends A {
+ function foo($arg1 = 2, $arg2 = 3) {
+ var_dump($arg1);
+ var_dump($arg2);
+ }
+}
+
+class C extends A {
+ function foo() {
+ }
+}
+
+$b = new B();
+
+$b->foo(1);
+
+?>
+--EXPECTF--
+Strict Standards: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d
+int(1)
+int(3)
diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt
new file mode 100644
index 0000000..669a8ca
--- /dev/null
+++ b/tests/classes/method_override_optional_arg_002.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Omitting optional arg in method inherited from abstract class
+--FILE--
+<?php
+
+abstract class A {
+ function foo($arg = 1) {}
+}
+
+class B extends A {
+ function foo() {
+ echo "foo\n";
+ }
+}
+
+$b = new B();
+$b->foo();
+
+?>
+--EXPECTF--
+Strict Standards: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d
+foo
diff --git a/tests/classes/new_001.phpt b/tests/classes/new_001.phpt
new file mode 100644
index 0000000..ee7d352
--- /dev/null
+++ b/tests/classes/new_001.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Confirm difference between assigning new directly and by reference.
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+ echo "Compile-time strict error message should precede this.\n";
+
+ class Inc
+ {
+ private static $counter = 0;
+ function __construct()
+ {
+ $this->id = ++Inc::$counter;
+ }
+ }
+
+ $f = new Inc();
+ $k =& $f;
+ echo "\$f initially points to the first object:\n";
+ var_dump($f);
+
+ echo "Assigning new object directly to \$k affects \$f:\n";
+ $k = new Inc();
+ var_dump($f);
+
+ echo "Assigning new object by ref to \$k removes it from \$f's reference set, so \$f is unchanged:\n";
+ $k =& new Inc();
+ var_dump($f);
+?>
+--EXPECTF--
+Deprecated: Assigning the return value of new by reference is deprecated in %s on line 23
+Compile-time strict error message should precede this.
+$f initially points to the first object:
+object(Inc)#%d (1) {
+ ["id"]=>
+ int(1)
+}
+Assigning new object directly to $k affects $f:
+object(Inc)#%d (1) {
+ ["id"]=>
+ int(2)
+}
+Assigning new object by ref to $k removes it from $f's reference set, so $f is unchanged:
+object(Inc)#%d (1) {
+ ["id"]=>
+ int(2)
+}
diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt
new file mode 100644
index 0000000..74acb5d
--- /dev/null
+++ b/tests/classes/object_reference_001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+ZE2 object references
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Foo {
+ public $name;
+
+ function Foo() {
+ $this->name = "I'm Foo!\n";
+ }
+}
+
+$foo = new Foo;
+echo $foo->name;
+$bar = $foo;
+$bar->name = "I'm Bar!\n";
+
+// In ZE1, we would expect "I'm Foo!"
+echo $foo->name;
+
+?>
+--EXPECT--
+I'm Foo!
+I'm Bar!
diff --git a/tests/classes/private_001.phpt b/tests/classes/private_001.phpt
new file mode 100644
index 0000000..310b9c6
--- /dev/null
+++ b/tests/classes/private_001.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 A private method can only be called inside the class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ private static function show() {
+ echo "Call show()\n";
+ }
+
+ public static function do_show() {
+ pass::show();
+ }
+}
+
+pass::do_show();
+pass::show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call show()
+
+Fatal error: Call to private method pass::show() from context '' in %s on line %d
diff --git a/tests/classes/private_002.phpt b/tests/classes/private_002.phpt
new file mode 100644
index 0000000..258fd3a
--- /dev/null
+++ b/tests/classes/private_002.phpt
@@ -0,0 +1,35 @@
+--TEST--
+ZE2 A private method cannot be called in another class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ private static function show() {
+ echo "Call pass::show()\n";
+ }
+
+ public static function do_show() {
+ pass::show();
+ }
+}
+
+pass::do_show();
+
+class fail {
+ public static function show() {
+ echo "Call fail::show()\n";
+ pass::show();
+ }
+}
+
+fail::show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call pass::show()
+Call fail::show()
+
+Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d
diff --git a/tests/classes/private_003.phpt b/tests/classes/private_003.phpt
new file mode 100644
index 0000000..716efbc
--- /dev/null
+++ b/tests/classes/private_003.phpt
@@ -0,0 +1,36 @@
+--TEST--
+ZE2 A private method cannot be called in a derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+ini_set("error_reporting",2039);
+class pass {
+ private static function show() {
+ echo "Call show()\n";
+ }
+
+ protected static function good() {
+ pass::show();
+ }
+}
+
+class fail extends pass {
+ static function ok() {
+ pass::good();
+ }
+
+ static function not_ok() {
+ pass::show();
+ }
+}
+
+fail::ok();
+fail::not_ok(); // calling a private function
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call show()
+
+Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d
diff --git a/tests/classes/private_003b.phpt b/tests/classes/private_003b.phpt
new file mode 100644
index 0000000..780b2e6
--- /dev/null
+++ b/tests/classes/private_003b.phpt
@@ -0,0 +1,37 @@
+--TEST--
+ZE2 A private method cannot be called in a derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ private function show() {
+ echo "Call show()\n";
+ }
+
+ protected function good() {
+ $this->show();
+ }
+}
+
+class fail extends pass {
+ public function ok() {
+ $this->good();
+ }
+
+ public function not_ok() {
+ $this->show();
+ }
+}
+
+$t = new fail();
+$t->ok();
+$t->not_ok(); // calling a private function
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call show()
+
+Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d
diff --git a/tests/classes/private_004.phpt b/tests/classes/private_004.phpt
new file mode 100644
index 0000000..027434a
--- /dev/null
+++ b/tests/classes/private_004.phpt
@@ -0,0 +1,32 @@
+--TEST--
+ZE2 A private method cannot be called in a derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ private static function show() {
+ echo "Call show()\n";
+ }
+
+ public static function do_show() {
+ pass::show();
+ }
+}
+
+class fail extends pass {
+ static function do_show() {
+ fail::show();
+ }
+}
+
+pass::do_show();
+fail::do_show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call show()
+
+Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d
diff --git a/tests/classes/private_004b.phpt b/tests/classes/private_004b.phpt
new file mode 100644
index 0000000..ea3fe61
--- /dev/null
+++ b/tests/classes/private_004b.phpt
@@ -0,0 +1,35 @@
+--TEST--
+ZE2 A private method cannot be called in a derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ private function show() {
+ echo "Call show()\n";
+ }
+
+ public function do_show() {
+ $this->show();
+ }
+}
+
+class fail extends pass {
+ function do_show() {
+ $this->show();
+ }
+}
+
+$t = new pass();
+$t->do_show();
+
+$t2 = new fail();
+$t2->do_show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call show()
+
+Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file
diff --git a/tests/classes/private_005.phpt b/tests/classes/private_005.phpt
new file mode 100644
index 0000000..49b2bee
--- /dev/null
+++ b/tests/classes/private_005.phpt
@@ -0,0 +1,32 @@
+--TEST--
+ZE2 A private method cannot be called in a derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ private static function show() {
+ echo "Call show()\n";
+ }
+
+ public static function do_show() {
+ pass::show();
+ }
+}
+
+class fail extends pass {
+ static function do_show() {
+ pass::show();
+ }
+}
+
+pass::do_show();
+fail::do_show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call show()
+
+Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d
diff --git a/tests/classes/private_005b.phpt b/tests/classes/private_005b.phpt
new file mode 100644
index 0000000..ea3fe61
--- /dev/null
+++ b/tests/classes/private_005b.phpt
@@ -0,0 +1,35 @@
+--TEST--
+ZE2 A private method cannot be called in a derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ private function show() {
+ echo "Call show()\n";
+ }
+
+ public function do_show() {
+ $this->show();
+ }
+}
+
+class fail extends pass {
+ function do_show() {
+ $this->show();
+ }
+}
+
+$t = new pass();
+$t->do_show();
+
+$t2 = new fail();
+$t2->do_show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call show()
+
+Fatal error: Call to private method pass::show() from context 'fail' in %s on line %d \ No newline at end of file
diff --git a/tests/classes/private_006.phpt b/tests/classes/private_006.phpt
new file mode 100644
index 0000000..0bb2b3f
--- /dev/null
+++ b/tests/classes/private_006.phpt
@@ -0,0 +1,41 @@
+--TEST--
+ZE2 A private method can be overwritten in a second derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class first {
+ private static function show() {
+ echo "Call show()\n";
+ }
+
+ public static function do_show() {
+ first::show();
+ }
+}
+
+first::do_show();
+
+class second extends first {
+}
+
+second::do_show();
+
+class third extends second {
+}
+
+third::do_show();
+
+class fail extends third {
+ static function show() { // cannot be redeclared
+ echo "Call show()\n";
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Call show()
+Call show()
+Call show()
+Done
diff --git a/tests/classes/private_006b.phpt b/tests/classes/private_006b.phpt
new file mode 100644
index 0000000..950f16a
--- /dev/null
+++ b/tests/classes/private_006b.phpt
@@ -0,0 +1,41 @@
+--TEST--
+ZE2 A private method can be overwritten in a second derived class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class first {
+ private function show() {
+ echo "Call show()\n";
+ }
+
+ public function do_show() {
+ $this->show();
+ }
+}
+
+$t1 = new first();
+$t1->do_show();
+
+class second extends first {
+}
+
+//$t2 = new second();
+//$t2->do_show();
+
+class third extends second {
+ private function show() {
+ echo "Call show()\n";
+ }
+}
+
+$t3 = new third();
+$t3->do_show();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Call show()
+Call show()
+Done \ No newline at end of file
diff --git a/tests/classes/private_007.phpt b/tests/classes/private_007.phpt
new file mode 100644
index 0000000..73a38c4
--- /dev/null
+++ b/tests/classes/private_007.phpt
@@ -0,0 +1,30 @@
+--TEST--
+ZE2 A derived class does not know about privates of ancestors
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Bar {
+ public static function pub() {
+ Bar::priv();
+ }
+ private static function priv() {
+ echo "Bar::priv()\n";
+ }
+}
+class Foo extends Bar {
+ public static function priv() {
+ echo "Foo::priv()\n";
+ }
+}
+
+Foo::pub();
+Foo::priv();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Bar::priv()
+Foo::priv()
+Done
diff --git a/tests/classes/private_007b.phpt b/tests/classes/private_007b.phpt
new file mode 100644
index 0000000..02ddc25
--- /dev/null
+++ b/tests/classes/private_007b.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 A derived class does not know about privates of ancestors
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Bar {
+ public function pub() {
+ $this->priv();
+ }
+ private function priv() {
+ echo "Bar::priv()\n";
+ }
+}
+class Foo extends Bar {
+ public function priv() {
+ echo "Foo::priv()\n";
+ }
+}
+
+$obj = new Foo();
+$obj->pub();
+$obj->priv();
+
+echo "Done\n";
+?>
+--EXPECTF--
+Bar::priv()
+Foo::priv()
+Done
diff --git a/tests/classes/private_members.phpt b/tests/classes/private_members.phpt
new file mode 100644
index 0000000..a8ef9ab
--- /dev/null
+++ b/tests/classes/private_members.phpt
@@ -0,0 +1,103 @@
+--TEST--
+ZE2 A private member is
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class base
+{
+ private $member;
+
+ function __construct()
+ {
+ echo __METHOD__ . "(begin)\n";
+ $this->member = 'base::member';
+ $this->test();
+ echo __METHOD__ . "(end)\n";
+ }
+
+ function test()
+ {
+ echo __METHOD__ . "\n";
+ print_r($this);
+ }
+}
+
+class derived extends base
+{
+ public $member = 'derived::member (default)';
+
+ function __construct()
+ {
+ echo __METHOD__ . "(begin)\n";
+ parent::__construct();
+ parent::test();
+ $this->test();
+ $this->member = 'derived::member';
+ echo __METHOD__ . "(end)\n";
+ }
+
+ function test()
+ {
+ parent::test();
+ echo __METHOD__ . "\n";
+ print_r($this);
+ }
+}
+
+$t = new derived;
+$t->test();
+unset($t);
+
+echo "Done\n";
+
+?>
+--EXPECTF--
+derived::__construct(begin)
+base::__construct(begin)
+base::test
+derived Object
+(
+ [member] => derived::member (default)
+ [member:base:private] => base::member
+)
+derived::test
+derived Object
+(
+ [member] => derived::member (default)
+ [member:base:private] => base::member
+)
+base::__construct(end)
+base::test
+derived Object
+(
+ [member] => derived::member (default)
+ [member:base:private] => base::member
+)
+base::test
+derived Object
+(
+ [member] => derived::member (default)
+ [member:base:private] => base::member
+)
+derived::test
+derived Object
+(
+ [member] => derived::member (default)
+ [member:base:private] => base::member
+)
+derived::__construct(end)
+base::test
+derived Object
+(
+ [member] => derived::member
+ [member:base:private] => base::member
+)
+derived::test
+derived Object
+(
+ [member] => derived::member
+ [member:base:private] => base::member
+)
+Done
diff --git a/tests/classes/private_redeclare.phpt b/tests/classes/private_redeclare.phpt
new file mode 100644
index 0000000..e3061f1
--- /dev/null
+++ b/tests/classes/private_redeclare.phpt
@@ -0,0 +1,38 @@
+--TEST--
+ZE2 A derived class does not know anything about inherited private methods
+--FILE--
+<?php
+class base {
+ private function show() {
+ echo "base\n";
+ }
+ function test() {
+ $this->show();
+ }
+}
+
+$t = new base();
+$t->test();
+
+class derived extends base {
+ function show() {
+ echo "derived\n";
+ }
+ function test() {
+ echo "test\n";
+ $this->show();
+ parent::test();
+ parent::show();
+ }
+}
+
+$t = new derived();
+$t->test();
+?>
+--EXPECTF--
+base
+test
+derived
+base
+
+Fatal error: Call to private method base::show() from context 'derived' in %s on line %d
diff --git a/tests/classes/property_override_privateStatic_private.phpt b/tests/classes/property_override_privateStatic_private.phpt
new file mode 100644
index 0000000..ddd2e5d
--- /dev/null
+++ b/tests/classes/property_override_privateStatic_private.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited private static property as private.
+--FILE--
+<?php
+ class A
+ {
+ private static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p
diff --git a/tests/classes/property_override_privateStatic_privateStatic.phpt b/tests/classes/property_override_privateStatic_privateStatic.phpt
new file mode 100644
index 0000000..d7d645f
--- /dev/null
+++ b/tests/classes/property_override_privateStatic_privateStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited private static property as private static.
+--FILE--
+<?php
+ class A
+ {
+ private static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p (static)
diff --git a/tests/classes/property_override_privateStatic_protected.phpt b/tests/classes/property_override_privateStatic_protected.phpt
new file mode 100644
index 0000000..d473216
--- /dev/null
+++ b/tests/classes/property_override_privateStatic_protected.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited private static property as protected.
+--FILE--
+<?php
+ class A
+ {
+ private static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p
diff --git a/tests/classes/property_override_privateStatic_protectedStatic.phpt b/tests/classes/property_override_privateStatic_protectedStatic.phpt
new file mode 100644
index 0000000..169ff9a
--- /dev/null
+++ b/tests/classes/property_override_privateStatic_protectedStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited private static property as protected static.
+--FILE--
+<?php
+ class A
+ {
+ private static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p (static)
diff --git a/tests/classes/property_override_privateStatic_public.phpt b/tests/classes/property_override_privateStatic_public.phpt
new file mode 100644
index 0000000..033eb75
--- /dev/null
+++ b/tests/classes/property_override_privateStatic_public.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited private static property as public.
+--FILE--
+<?php
+ class A
+ {
+ private static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p
diff --git a/tests/classes/property_override_privateStatic_publicStatic.phpt b/tests/classes/property_override_privateStatic_publicStatic.phpt
new file mode 100644
index 0000000..5f2b6bf
--- /dev/null
+++ b/tests/classes/property_override_privateStatic_publicStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited private static property as public static.
+--FILE--
+<?php
+ class A
+ {
+ private static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p (static)
diff --git a/tests/classes/property_override_private_private.phpt b/tests/classes/property_override_private_private.phpt
new file mode 100644
index 0000000..2b263ee
--- /dev/null
+++ b/tests/classes/property_override_private_private.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited private property as private.
+--FILE--
+<?php
+ class A
+ {
+ private $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p
+A::p
+B::p
diff --git a/tests/classes/property_override_private_privateStatic.phpt b/tests/classes/property_override_private_privateStatic.phpt
new file mode 100644
index 0000000..606ed21
--- /dev/null
+++ b/tests/classes/property_override_private_privateStatic.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited private property as private static.
+--FILE--
+<?php
+ class A
+ {
+ private $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p
+A::p
+B::p (static)
diff --git a/tests/classes/property_override_private_protected.phpt b/tests/classes/property_override_private_protected.phpt
new file mode 100644
index 0000000..b84ed67
--- /dev/null
+++ b/tests/classes/property_override_private_protected.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited private property as protected.
+--FILE--
+<?php
+ class A
+ {
+ private $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p
+A::p
+B::p
diff --git a/tests/classes/property_override_private_protectedStatic.phpt b/tests/classes/property_override_private_protectedStatic.phpt
new file mode 100644
index 0000000..1bb303d
--- /dev/null
+++ b/tests/classes/property_override_private_protectedStatic.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited private property as protected static.
+--FILE--
+<?php
+ class A
+ {
+ private $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p
+A::p
+B::p (static)
diff --git a/tests/classes/property_override_private_public.phpt b/tests/classes/property_override_private_public.phpt
new file mode 100644
index 0000000..badbe91
--- /dev/null
+++ b/tests/classes/property_override_private_public.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited private property as public.
+--FILE--
+<?php
+ class A
+ {
+ private $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p
+A::p
+B::p
diff --git a/tests/classes/property_override_private_publicStatic.phpt b/tests/classes/property_override_private_publicStatic.phpt
new file mode 100644
index 0000000..9fc58ec
--- /dev/null
+++ b/tests/classes/property_override_private_publicStatic.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited private property as public static.
+--FILE--
+<?php
+ class A
+ {
+ private $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p
+A::p
+B::p (static)
diff --git a/tests/classes/property_override_protectedStatic_private.phpt b/tests/classes/property_override_protectedStatic_private.phpt
new file mode 100644
index 0000000..18e9c78
--- /dev/null
+++ b/tests/classes/property_override_protectedStatic_private.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected static property as private.
+--FILE--
+<?php
+ class A
+ {
+ protected static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18
+
diff --git a/tests/classes/property_override_protectedStatic_privateStatic.phpt b/tests/classes/property_override_protectedStatic_privateStatic.phpt
new file mode 100644
index 0000000..6886210
--- /dev/null
+++ b/tests/classes/property_override_protectedStatic_privateStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited protected static property as private static.
+--FILE--
+<?php
+ class A
+ {
+ protected static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Access level to B::$p must be protected (as in class A) or weaker in %s on line 18
+
diff --git a/tests/classes/property_override_protectedStatic_protected.phpt b/tests/classes/property_override_protectedStatic_protected.phpt
new file mode 100644
index 0000000..0e5fdd3
--- /dev/null
+++ b/tests/classes/property_override_protectedStatic_protected.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected static property as protected.
+--FILE--
+<?php
+ class A
+ {
+ protected static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18
+
diff --git a/tests/classes/property_override_protectedStatic_protectedStatic.phpt b/tests/classes/property_override_protectedStatic_protectedStatic.phpt
new file mode 100644
index 0000000..16f1100
--- /dev/null
+++ b/tests/classes/property_override_protectedStatic_protectedStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited protected static property as protected static.
+--FILE--
+<?php
+ class A
+ {
+ protected static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p (static)
diff --git a/tests/classes/property_override_protectedStatic_public.phpt b/tests/classes/property_override_protectedStatic_public.phpt
new file mode 100644
index 0000000..6303325
--- /dev/null
+++ b/tests/classes/property_override_protectedStatic_public.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected static property as public.
+--FILE--
+<?php
+ class A
+ {
+ protected static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18
+
diff --git a/tests/classes/property_override_protectedStatic_publicStatic.phpt b/tests/classes/property_override_protectedStatic_publicStatic.phpt
new file mode 100644
index 0000000..e437c5f
--- /dev/null
+++ b/tests/classes/property_override_protectedStatic_publicStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected static property as public static.
+--FILE--
+<?php
+ class A
+ {
+ protected static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p (static)
+
diff --git a/tests/classes/property_override_protected_private.phpt b/tests/classes/property_override_protected_private.phpt
new file mode 100644
index 0000000..22cceda
--- /dev/null
+++ b/tests/classes/property_override_protected_private.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected property as private (duplicates Zend/tests/errmsg_023.phpt).
+--FILE--
+<?php
+ class A
+ {
+ protected $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Access level to B::$p must be protected (as in class A) or weaker in %s on line 18
diff --git a/tests/classes/property_override_protected_privateStatic.phpt b/tests/classes/property_override_protected_privateStatic.phpt
new file mode 100644
index 0000000..fb7102c
--- /dev/null
+++ b/tests/classes/property_override_protected_privateStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected property as private static.
+--FILE--
+<?php
+ class A
+ {
+ protected $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18
diff --git a/tests/classes/property_override_protected_protected.phpt b/tests/classes/property_override_protected_protected.phpt
new file mode 100644
index 0000000..c4b0d43
--- /dev/null
+++ b/tests/classes/property_override_protected_protected.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited protected property as protected.
+--FILE--
+<?php
+ class A
+ {
+ protected $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p
+B::p
+B::p
diff --git a/tests/classes/property_override_protected_protectedStatic.phpt b/tests/classes/property_override_protected_protectedStatic.phpt
new file mode 100644
index 0000000..1ce4130
--- /dev/null
+++ b/tests/classes/property_override_protected_protectedStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected property as protected static.
+--FILE--
+<?php
+ class A
+ {
+ protected $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18
diff --git a/tests/classes/property_override_protected_public.phpt b/tests/classes/property_override_protected_public.phpt
new file mode 100644
index 0000000..4702f9a
--- /dev/null
+++ b/tests/classes/property_override_protected_public.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited protected property as public.
+--FILE--
+<?php
+ class A
+ {
+ protected $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p
+B::p
+B::p
diff --git a/tests/classes/property_override_protected_publicStatic.phpt b/tests/classes/property_override_protected_publicStatic.phpt
new file mode 100644
index 0000000..8efdf5f
--- /dev/null
+++ b/tests/classes/property_override_protected_publicStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited protected property as public static.
+--FILE--
+<?php
+ class A
+ {
+ protected $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18
diff --git a/tests/classes/property_override_publicStatic_private.phpt b/tests/classes/property_override_publicStatic_private.phpt
new file mode 100644
index 0000000..7abe92c
--- /dev/null
+++ b/tests/classes/property_override_publicStatic_private.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited public static property as private.
+--FILE--
+<?php
+ class A
+ {
+ public static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18
+
diff --git a/tests/classes/property_override_publicStatic_privateStatic.phpt b/tests/classes/property_override_publicStatic_privateStatic.phpt
new file mode 100644
index 0000000..d41db6d
--- /dev/null
+++ b/tests/classes/property_override_publicStatic_privateStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited public static property as private static.
+--FILE--
+<?php
+ class A
+ {
+ public static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18
+
diff --git a/tests/classes/property_override_publicStatic_protected.phpt b/tests/classes/property_override_publicStatic_protected.phpt
new file mode 100644
index 0000000..884159f
--- /dev/null
+++ b/tests/classes/property_override_publicStatic_protected.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited public static property as protected.
+--FILE--
+<?php
+ class A
+ {
+ public static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18
+
diff --git a/tests/classes/property_override_publicStatic_protectedStatic.phpt b/tests/classes/property_override_publicStatic_protectedStatic.phpt
new file mode 100644
index 0000000..b022ef8
--- /dev/null
+++ b/tests/classes/property_override_publicStatic_protectedStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited public static property as protected static.
+--FILE--
+<?php
+ class A
+ {
+ public static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18
+
diff --git a/tests/classes/property_override_publicStatic_public.phpt b/tests/classes/property_override_publicStatic_public.phpt
new file mode 100644
index 0000000..d099da0
--- /dev/null
+++ b/tests/classes/property_override_publicStatic_public.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited public static property as public.
+--FILE--
+<?php
+ class A
+ {
+ public static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 18
+
diff --git a/tests/classes/property_override_publicStatic_publicStatic.phpt b/tests/classes/property_override_publicStatic_publicStatic.phpt
new file mode 100644
index 0000000..9a86867
--- /dev/null
+++ b/tests/classes/property_override_publicStatic_publicStatic.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Redeclare inherited public static property as public static.
+--FILE--
+<?php
+ class A
+ {
+ public static $p = "A::p (static)";
+ static function showA()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ A::showA();
+
+ B::showA();
+ B::showB();
+?>
+--EXPECTF--
+A::p (static)
+A::p (static)
+B::p (static)
diff --git a/tests/classes/property_override_public_private.phpt b/tests/classes/property_override_public_private.phpt
new file mode 100644
index 0000000..c0f37ad
--- /dev/null
+++ b/tests/classes/property_override_public_private.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited public property as private.
+--FILE--
+<?php
+ class A
+ {
+ public $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18
+
diff --git a/tests/classes/property_override_public_privateStatic.phpt b/tests/classes/property_override_public_privateStatic.phpt
new file mode 100644
index 0000000..36223fd
--- /dev/null
+++ b/tests/classes/property_override_public_privateStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited public property as private static.
+--FILE--
+<?php
+ class A
+ {
+ public $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ private static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18
diff --git a/tests/classes/property_override_public_protected.phpt b/tests/classes/property_override_public_protected.phpt
new file mode 100644
index 0000000..68fdf82
--- /dev/null
+++ b/tests/classes/property_override_public_protected.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited public property as protected.
+--FILE--
+<?php
+ class A
+ {
+ public $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+
+Fatal error: Access level to B::$p must be public (as in class A) in %s on line 18
+
diff --git a/tests/classes/property_override_public_protectedStatic.phpt b/tests/classes/property_override_public_protectedStatic.phpt
new file mode 100644
index 0000000..77e7ebf
--- /dev/null
+++ b/tests/classes/property_override_public_protectedStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited public property as protected static.
+--FILE--
+<?php
+ class A
+ {
+ public $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ protected static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18
diff --git a/tests/classes/property_override_public_public.phpt b/tests/classes/property_override_public_public.phpt
new file mode 100644
index 0000000..893fe5d
--- /dev/null
+++ b/tests/classes/property_override_public_public.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Redeclare inherited public property as public.
+--FILE--
+<?php
+ class A
+ {
+ public $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public $p = "B::p";
+ function showB()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ $b->showB();
+?>
+--EXPECTF--
+A::p
+B::p
+B::p
diff --git a/tests/classes/property_override_public_publicStatic.phpt b/tests/classes/property_override_public_publicStatic.phpt
new file mode 100644
index 0000000..725e947
--- /dev/null
+++ b/tests/classes/property_override_public_publicStatic.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Redeclare inherited public property as public static.
+--FILE--
+<?php
+ class A
+ {
+ public $p = "A::p";
+ function showA()
+ {
+ echo $this->p . "\n";
+ }
+ }
+
+ class B extends A
+ {
+ public static $p = "B::p (static)";
+ static function showB()
+ {
+ echo self::$p . "\n";
+ }
+ }
+
+
+ $a = new A;
+ $a->showA();
+
+ $b = new B;
+ $b->showA();
+ B::showB();
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 18
diff --git a/tests/classes/property_recreate_private.phpt b/tests/classes/property_recreate_private.phpt
new file mode 100644
index 0000000..8bcf485
--- /dev/null
+++ b/tests/classes/property_recreate_private.phpt
@@ -0,0 +1,81 @@
+--TEST--
+Unsetting and recreating private properties.
+--FILE--
+<?php
+class C {
+ private $p = 'test';
+ function unsetPrivate() {
+ unset($this->p);
+ }
+ function setPrivate() {
+ $this->p = 'changed';
+ }
+}
+
+class D extends C {
+ function setP() {
+ $this->p = 'changed in D';
+ }
+}
+
+echo "Unset and recreate a superclass's private property:\n";
+$d = new D;
+$d->unsetPrivate();
+$d->setPrivate();
+var_dump($d);
+
+echo "\nUnset superclass's private property, and recreate it as public in subclass:\n";
+$d = new D;
+$d->unsetPrivate();
+$d->setP();
+var_dump($d);
+
+echo "\nUnset superclass's private property, and recreate it as public at global scope:\n";
+$d = new D;
+$d->unsetPrivate();
+$d->p = 'this will create a public property';
+var_dump($d);
+
+
+echo "\n\nUnset and recreate a private property:\n";
+$c = new C;
+$c->unsetPrivate();
+$c->setPrivate();
+var_dump($c);
+
+echo "\nUnset a private property, and attempt to recreate at global scope (expecting failure):\n";
+$c = new C;
+$c->unsetPrivate();
+$c->p = 'this will fail';
+var_dump($c);
+?>
+==Done==
+--EXPECTF--
+Unset and recreate a superclass's private property:
+object(D)#%d (1) {
+ [%u|b%"p":%u|b%"C":private]=>
+ %unicode|string%(7) "changed"
+}
+
+Unset superclass's private property, and recreate it as public in subclass:
+object(D)#%d (1) {
+ [%u|b%"p"]=>
+ %unicode|string%(12) "changed in D"
+}
+
+Unset superclass's private property, and recreate it as public at global scope:
+object(D)#%d (1) {
+ [%u|b%"p"]=>
+ %unicode|string%(34) "this will create a public property"
+}
+
+
+Unset and recreate a private property:
+object(C)#%d (1) {
+ [%u|b%"p":%u|b%"C":private]=>
+ %unicode|string%(7) "changed"
+}
+
+Unset a private property, and attempt to recreate at global scope (expecting failure):
+
+Fatal error: Cannot access private property C::$p in %s on line 46 \ No newline at end of file
diff --git a/tests/classes/property_recreate_protected.phpt b/tests/classes/property_recreate_protected.phpt
new file mode 100644
index 0000000..4da4de8
--- /dev/null
+++ b/tests/classes/property_recreate_protected.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Unsetting and recreating protected properties.
+--FILE--
+<?php
+class C {
+ protected $p = 'test';
+ function unsetProtected() {
+ unset($this->p);
+ }
+ function setProtected() {
+ $this->p = 'changed';
+ }
+}
+
+class D extends C {
+ function setP() {
+ $this->p = 'changed in D';
+ }
+}
+
+$d = new D;
+echo "Unset and recreate a protected property from property's declaring class scope:\n";
+$d->unsetProtected();
+$d->setProtected();
+var_dump($d);
+
+echo "\nUnset and recreate a protected property from subclass:\n";
+$d = new D;
+$d->unsetProtected();
+$d->setP();
+var_dump($d);
+
+echo "\nUnset a protected property, and attempt to recreate it outside of scope (expected failure):\n";
+$d->unsetProtected();
+$d->p = 'this will fail';
+var_dump($d);
+?>
+--EXPECTF--
+Unset and recreate a protected property from property's declaring class scope:
+object(D)#%d (1) {
+ [%u|b%"p":protected]=>
+ %unicode|string%(7) "changed"
+}
+
+Unset and recreate a protected property from subclass:
+object(D)#%d (1) {
+ [%u|b%"p":protected]=>
+ %unicode|string%(12) "changed in D"
+}
+
+Unset a protected property, and attempt to recreate it outside of scope (expected failure):
+
+Fatal error: Cannot access protected property %s::$p in %s on line 32 \ No newline at end of file
diff --git a/tests/classes/protected_001.phpt b/tests/classes/protected_001.phpt
new file mode 100644
index 0000000..19872c6
--- /dev/null
+++ b/tests/classes/protected_001.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 A protected method can only be called inside the class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ protected static function fail() {
+ echo "Call fail()\n";
+ }
+
+ public static function good() {
+ pass::fail();
+ }
+}
+
+pass::good();
+pass::fail();// must fail because we are calling from outside of class pass
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call fail()
+
+Fatal error: Call to protected method pass::fail() from context '' in %s on line %d
diff --git a/tests/classes/protected_001b.phpt b/tests/classes/protected_001b.phpt
new file mode 100644
index 0000000..4d24a92
--- /dev/null
+++ b/tests/classes/protected_001b.phpt
@@ -0,0 +1,27 @@
+--TEST--
+ZE2 A protected method can only be called inside the class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ protected function fail() {
+ echo "Call fail()\n";
+ }
+
+ public function good() {
+ $this->fail();
+ }
+}
+
+$t = new pass();
+$t->good();
+$t->fail();// must fail because we are calling from outside of class pass
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call fail()
+
+Fatal error: Call to protected method pass::fail() from context '' in %s on line %d
diff --git a/tests/classes/protected_002.phpt b/tests/classes/protected_002.phpt
new file mode 100644
index 0000000..f26ef9c
--- /dev/null
+++ b/tests/classes/protected_002.phpt
@@ -0,0 +1,35 @@
+--TEST--
+ZE2 A protected method cannot be called in another class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ protected static function show() {
+ echo "Call pass::show()\n";
+ }
+
+ public static function do_show() {
+ pass::show();
+ }
+}
+
+pass::do_show();
+
+class fail {
+ public static function show() {
+ echo "Call fail::show()\n";
+ pass::show();
+ }
+}
+
+fail::show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Call pass::show()
+Call fail::show()
+
+Fatal error: Call to protected method pass::show() from context 'fail' in %s on line %d
diff --git a/tests/classes/serialize_001.phpt b/tests/classes/serialize_001.phpt
new file mode 100644
index 0000000..142fc50
--- /dev/null
+++ b/tests/classes/serialize_001.phpt
@@ -0,0 +1,79 @@
+--TEST--
+ZE2 Serializable
+--FILE--
+<?php
+
+class Test implements Serializable
+{
+ public $data;
+
+ function __construct($data)
+ {
+ echo __METHOD__ . "($data)\n";
+ $this->data = $data;
+ }
+
+ function serialize()
+ {
+ echo __METHOD__ . "({$this->data})\n";
+ return $this->data;
+ }
+
+ function unserialize($serialized)
+ {
+ echo __METHOD__ . "($serialized)\n";
+ $this->data = $serialized;
+ var_dump($this);
+ }
+}
+
+$tests = array('String', NULL, 42, false);
+
+foreach($tests as $data)
+{
+ try
+ {
+ echo "==========\n";
+ var_dump($data);
+ $ser = serialize(new Test($data));
+ var_dump(unserialize($ser));
+ }
+ catch(Exception $e)
+ {
+ echo 'Exception: ' . $e->getMessage() . "\n";
+ }
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+==========
+%unicode|string%(6) "String"
+Test::__construct(String)
+Test::serialize(String)
+Test::unserialize(String)
+object(Test)#%d (1) {
+ [%u|b%"data"]=>
+ %unicode|string%(6) "String"
+}
+object(Test)#%d (1) {
+ [%u|b%"data"]=>
+ %unicode|string%(6) "String"
+}
+==========
+NULL
+Test::__construct()
+Test::serialize()
+NULL
+==========
+int(42)
+Test::__construct(42)
+Test::serialize(42)
+Exception: Test::serialize() must return a string or NULL
+==========
+bool(false)
+Test::__construct()
+Test::serialize()
+Exception: Test::serialize() must return a string or NULL
+===DONE===
diff --git a/tests/classes/singleton_001.phpt b/tests/classes/singleton_001.phpt
new file mode 100644
index 0000000..ee729b9
--- /dev/null
+++ b/tests/classes/singleton_001.phpt
@@ -0,0 +1,37 @@
+--TEST--
+ZE2 singleton
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Counter {
+ private $counter = 0;
+
+ function increment_and_print() {
+ echo ++$this->counter;
+ echo "\n";
+ }
+}
+
+
+class SingletonCounter {
+ private static $m_instance = NULL;
+
+ static function Instance() {
+ if (self::$m_instance == NULL) {
+ self::$m_instance = new Counter();
+ }
+ return self::$m_instance;
+ }
+}
+
+SingletonCounter::Instance()->increment_and_print();
+SingletonCounter::Instance()->increment_and_print();
+SingletonCounter::Instance()->increment_and_print();
+
+?>
+--EXPECT--
+1
+2
+3
diff --git a/tests/classes/static_mix_1.phpt b/tests/classes/static_mix_1.phpt
new file mode 100644
index 0000000..ecc9c01
--- /dev/null
+++ b/tests/classes/static_mix_1.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 You cannot overload a static method with a non static method
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ static function show() {
+ echo "Call to function pass::show()\n";
+ }
+}
+
+class fail extends pass {
+ function show() {
+ echo "Call to function fail::show()\n";
+ }
+}
+
+pass::show();
+fail::show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Cannot make static method pass::show() non static in class fail in %s on line %d \ No newline at end of file
diff --git a/tests/classes/static_mix_2.phpt b/tests/classes/static_mix_2.phpt
new file mode 100644
index 0000000..bbdaedf
--- /dev/null
+++ b/tests/classes/static_mix_2.phpt
@@ -0,0 +1,27 @@
+--TEST--
+ZE2 You cannot overload a non static method with a static method
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+ function show() {
+ echo "Call to function pass::show()\n";
+ }
+}
+
+class fail extends pass {
+ static function show() {
+ echo "Call to function fail::show()\n";
+ }
+}
+
+$t = new pass();
+$t->show();
+fail::show();
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Cannot make non static method pass::show() static in class fail in %s on line %d \ No newline at end of file
diff --git a/tests/classes/static_properties_001.phpt b/tests/classes/static_properties_001.phpt
new file mode 100644
index 0000000..1c34f68
--- /dev/null
+++ b/tests/classes/static_properties_001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+ZE2 Initializing static properties to arrays
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class test {
+ static public $ar = array();
+}
+
+var_dump(test::$ar);
+
+test::$ar[] = 1;
+
+var_dump(test::$ar);
+
+echo "Done\n";
+?>
+--EXPECTF--
+array(0) {
+}
+array(1) {
+ [0]=>
+ int(1)
+}
+Done
diff --git a/tests/classes/static_properties_003.phpt b/tests/classes/static_properties_003.phpt
new file mode 100644
index 0000000..2441e41
--- /dev/null
+++ b/tests/classes/static_properties_003.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Attempting to access static properties using instance property syntax
+--FILE--
+<?php
+class C {
+ public static $x = 'C::$x';
+ protected static $y = 'C::$y';
+}
+
+$c = new C;
+
+echo "\n--> Access visible static prop like instance prop:\n";
+var_dump(isset($c->x));
+unset($c->x);
+echo $c->x;
+$c->x = 1;
+$ref = 'ref';
+$c->x =& $ref;
+var_dump($c->x, C::$x);
+
+echo "\n--> Access non-visible static prop like instance prop:\n";
+var_dump(isset($c->y));
+//unset($c->y); // Fatal error, tested in static_properties_003_error1.phpt
+//echo $c->y; // Fatal error, tested in static_properties_003_error2.phpt
+//$c->y = 1; // Fatal error, tested in static_properties_003_error3.phpt
+//$c->y =& $ref; // Fatal error, tested in static_properties_003_error4.phpt
+?>
+==Done==
+--EXPECTF--
+--> Access visible static prop like instance prop:
+bool(false)
+
+Strict Standards: Accessing static property C::$x as non static in %s on line 11
+
+Strict Standards: Accessing static property C::$x as non static in %s on line 12
+
+Notice: Undefined property: C::$x in %s on line 12
+
+Strict Standards: Accessing static property C::$x as non static in %s on line 13
+
+Strict Standards: Accessing static property C::$x as non static in %s on line 15
+
+Strict Standards: Accessing static property C::$x as non static in %s on line 16
+%unicode|string%(3) "ref"
+%unicode|string%(5) "C::$x"
+
+--> Access non-visible static prop like instance prop:
+bool(false)
+==Done== \ No newline at end of file
diff --git a/tests/classes/static_properties_003_error1.phpt b/tests/classes/static_properties_003_error1.phpt
new file mode 100644
index 0000000..7a5e3d9
--- /dev/null
+++ b/tests/classes/static_properties_003_error1.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Attempting to access static properties using instance property syntax
+--FILE--
+<?php
+class C {
+ protected static $y = 'C::$y';
+}
+$c = new C;
+
+echo "\n--> Access non-visible static prop like instance prop:\n";
+unset($c->y);
+?>
+==Done==
+--EXPECTF--
+
+--> Access non-visible static prop like instance prop:
+
+Fatal error: Cannot access protected property C::$y in %s on line 8
diff --git a/tests/classes/static_properties_003_error2.phpt b/tests/classes/static_properties_003_error2.phpt
new file mode 100644
index 0000000..589cc69
--- /dev/null
+++ b/tests/classes/static_properties_003_error2.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Attempting to access static properties using instance property syntax
+--FILE--
+<?php
+class C {
+ protected static $y = 'C::$y';
+}
+$c = new C;
+
+echo "\n--> Access non-visible static prop like instance prop:\n";
+echo $c->y;
+?>
+==Done==
+--EXPECTF--
+
+--> Access non-visible static prop like instance prop:
+
+Fatal error: Cannot access protected property C::$y in %s on line 8
diff --git a/tests/classes/static_properties_003_error3.phpt b/tests/classes/static_properties_003_error3.phpt
new file mode 100644
index 0000000..3e01e0e
--- /dev/null
+++ b/tests/classes/static_properties_003_error3.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Attempting to access static properties using instance property syntax
+--FILE--
+<?php
+class C {
+ protected static $y = 'C::$y';
+}
+$c = new C;
+
+echo "\n--> Access non-visible static prop like instance prop:\n";
+$c->y = 1;
+?>
+==Done==
+--EXPECTF--
+
+--> Access non-visible static prop like instance prop:
+
+Fatal error: Cannot access protected property C::$y in %s on line 8
diff --git a/tests/classes/static_properties_003_error4.phpt b/tests/classes/static_properties_003_error4.phpt
new file mode 100644
index 0000000..fd69a9f
--- /dev/null
+++ b/tests/classes/static_properties_003_error4.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Attempting to access static properties using instance property syntax
+--FILE--
+<?php
+class C {
+ protected static $y = 'C::$y';
+}
+$c = new C;
+
+echo "\n--> Access non-visible static prop like instance prop:\n";
+$c->y =& $ref;
+?>
+==Done==
+--EXPECTF--
+
+--> Access non-visible static prop like instance prop:
+
+Fatal error: Cannot access protected property C::$y in %s on line 8
diff --git a/tests/classes/static_properties_004.phpt b/tests/classes/static_properties_004.phpt
new file mode 100644
index 0000000..ce1d19d
--- /dev/null
+++ b/tests/classes/static_properties_004.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Inherited static properties can be separated from their reference set.
+--FILE--
+<?php
+class C { public static $p = 'original'; }
+class D extends C { }
+class E extends D { }
+
+echo "\nInherited static properties refer to the same value accross classes:\n";
+var_dump(C::$p, D::$p, E::$p);
+
+echo "\nChanging one changes all the others:\n";
+D::$p = 'changed.all';
+var_dump(C::$p, D::$p, E::$p);
+
+echo "\nBut because this is implemented using PHP references, the reference set can easily be split:\n";
+$ref = 'changed.one';
+D::$p =& $ref;
+var_dump(C::$p, D::$p, E::$p);
+?>
+==Done==
+--EXPECTF--
+Inherited static properties refer to the same value accross classes:
+%unicode|string%(8) "original"
+%unicode|string%(8) "original"
+%unicode|string%(8) "original"
+
+Changing one changes all the others:
+%unicode|string%(11) "changed.all"
+%unicode|string%(11) "changed.all"
+%unicode|string%(11) "changed.all"
+
+But because this is implemented using PHP references, the reference set can easily be split:
+%unicode|string%(11) "changed.all"
+%unicode|string%(11) "changed.one"
+%unicode|string%(11) "changed.all"
+==Done== \ No newline at end of file
diff --git a/tests/classes/static_properties_undeclared_assign.phpt b/tests/classes/static_properties_undeclared_assign.phpt
new file mode 100644
index 0000000..99340e9
--- /dev/null
+++ b/tests/classes/static_properties_undeclared_assign.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Assigning to a non-existent static property
+--FILE--
+<?php
+Class C {}
+C::$p = 1;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file
diff --git a/tests/classes/static_properties_undeclared_assignInc.phpt b/tests/classes/static_properties_undeclared_assignInc.phpt
new file mode 100644
index 0000000..258f2f8
--- /dev/null
+++ b/tests/classes/static_properties_undeclared_assignInc.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Assigning & incrementing a non-existent static property
+--FILE--
+<?php
+Class C {}
+C::$p += 1;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file
diff --git a/tests/classes/static_properties_undeclared_assignRef.phpt b/tests/classes/static_properties_undeclared_assignRef.phpt
new file mode 100644
index 0000000..75cf270
--- /dev/null
+++ b/tests/classes/static_properties_undeclared_assignRef.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Assigning a non-existent static property by reference
+--FILE--
+<?php
+Class C {}
+$a = 'foo';
+C::$p =& $a;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 4 \ No newline at end of file
diff --git a/tests/classes/static_properties_undeclared_inc.phpt b/tests/classes/static_properties_undeclared_inc.phpt
new file mode 100644
index 0000000..ff8b8c3
--- /dev/null
+++ b/tests/classes/static_properties_undeclared_inc.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Incrementing a non-existent static property
+--FILE--
+<?php
+Class C {}
+C::$p++;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file
diff --git a/tests/classes/static_properties_undeclared_isset.phpt b/tests/classes/static_properties_undeclared_isset.phpt
new file mode 100644
index 0000000..58aac40
--- /dev/null
+++ b/tests/classes/static_properties_undeclared_isset.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Issetting a non-existent static property
+--FILE--
+<?php
+Class C {}
+var_dump(isset(C::$p));
+?>
+--EXPECTF--
+bool(false) \ No newline at end of file
diff --git a/tests/classes/static_properties_undeclared_read.phpt b/tests/classes/static_properties_undeclared_read.phpt
new file mode 100644
index 0000000..715b41e
--- /dev/null
+++ b/tests/classes/static_properties_undeclared_read.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Reading a non-existent static property
+--FILE--
+<?php
+Class C {}
+echo C::$p;
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: C::$p in %s on line 3 \ No newline at end of file
diff --git a/tests/classes/static_this.phpt b/tests/classes/static_this.phpt
new file mode 100644
index 0000000..91b0287
--- /dev/null
+++ b/tests/classes/static_this.phpt
@@ -0,0 +1,39 @@
+--TEST--
+ZE2 $this can be an argument to a static function
+--FILE--
+<?php
+
+class TestClass
+{
+ function __construct()
+ {
+ self::Test1();
+ $this->Test1();
+ }
+
+ static function Test1()
+ {
+ var_dump($this);
+ }
+
+ static function Test2($this)
+ {
+ var_dump($this);
+ }
+}
+
+$obj = new TestClass;
+TestClass::Test2(new stdClass);
+
+?>
+===DONE===
+--EXPECTF--
+
+Notice: Undefined variable: this in %sstatic_this.php on line %d
+NULL
+
+Notice: Undefined variable: this in %sstatic_this.php on line %d
+NULL
+object(stdClass)#%d (0) {
+}
+===DONE===
diff --git a/tests/classes/this.phpt b/tests/classes/this.phpt
new file mode 100644
index 0000000..1d9c623
--- /dev/null
+++ b/tests/classes/this.phpt
@@ -0,0 +1,54 @@
+--TEST--
+ZE2 $this cannot be exchanged
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+/* please don't shorten this test. It shows what would happen if
+ * the fatal error would have been a warning.
+ */
+class Foo
+{
+ function replace($other)
+ {
+ echo __METHOD__ . "\n";
+ $this = $other;
+ print $this->prop;
+ print $other->prop;
+ }
+
+ function indirect($other)
+ {
+ echo __METHOD__ . "\n";
+ $this = $other;
+ $result = $this = $other;
+ print $result->prop;
+ print $this->prop;
+ }
+
+ function retrieve(&$other)
+ {
+ echo __METHOD__ . "\n";
+ $other = $this;
+ }
+}
+
+$object = new Foo;
+$object->prop = "Hello\n";
+
+$other = new Foo;
+$other->prop = "World\n";
+
+$object->replace($other);
+$object->indirect($other);
+
+print $object->prop; // still shows 'Hello'
+
+$object->retrieve($other);
+print $other->prop; // shows 'Hello'
+
+?>
+===DONE===
+--EXPECTF--
+Fatal error: Cannot re-assign $this in %sthis.php on line %d
diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt
new file mode 100644
index 0000000..53144ca
--- /dev/null
+++ b/tests/classes/tostring_001.phpt
@@ -0,0 +1,130 @@
+--TEST--
+ZE2 __toString()
+--FILE--
+<?php
+
+function my_error_handler($errno, $errstr, $errfile, $errline) {
+ var_dump($errstr);
+}
+
+set_error_handler('my_error_handler');
+
+class test1
+{
+}
+
+class test2
+{
+ function __toString()
+ {
+ echo __METHOD__ . "()\n";
+ return "Converted\n";
+ }
+}
+
+class test3
+{
+ function __toString()
+ {
+ echo __METHOD__ . "()\n";
+ return 42;
+ }
+}
+echo "====test1====\n";
+$o = new test1;
+print_r($o);
+var_dump((string)$o);
+var_dump($o);
+
+echo "====test2====\n";
+$o = new test2;
+print_r($o);
+print $o;
+var_dump($o);
+echo "====test3====\n";
+echo $o;
+
+echo "====test4====\n";
+echo "string:".$o;
+
+echo "====test5====\n";
+echo 1 . $o;
+echo 1 , $o;
+
+echo "====test6====\n";
+echo $o . $o;
+echo $o , $o;
+
+echo "====test7====\n";
+$ar = array();
+$ar[$o->__toString()] = "ERROR";
+echo $ar[$o];
+
+echo "====test8====\n";
+var_dump(trim($o));
+var_dump(trim((string)$o));
+
+echo "====test9====\n";
+echo sprintf("%s", $o);
+
+echo "====test10====\n";
+$o = new test3;
+var_dump($o);
+echo $o;
+
+?>
+====DONE====
+--EXPECTF--
+====test1====
+test1 Object
+(
+)
+string(54) "Object of class test1 could not be converted to string"
+string(0) ""
+object(test1)#%d (0) {
+}
+====test2====
+test2 Object
+(
+)
+test2::__toString()
+Converted
+object(test2)#%d (0) {
+}
+====test3====
+test2::__toString()
+Converted
+====test4====
+test2::__toString()
+string:Converted
+====test5====
+test2::__toString()
+1Converted
+1test2::__toString()
+Converted
+====test6====
+test2::__toString()
+test2::__toString()
+Converted
+Converted
+test2::__toString()
+Converted
+test2::__toString()
+Converted
+====test7====
+test2::__toString()
+string(19) "Illegal offset type"
+====test8====
+test2::__toString()
+string(9) "Converted"
+test2::__toString()
+string(9) "Converted"
+====test9====
+test2::__toString()
+Converted
+====test10====
+object(test3)#%d (0) {
+}
+test3::__toString()
+string(53) "Method test3::__toString() must return a string value"
+====DONE====
diff --git a/tests/classes/tostring_002.phpt b/tests/classes/tostring_002.phpt
new file mode 100644
index 0000000..8a4a7af
--- /dev/null
+++ b/tests/classes/tostring_002.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 __toString() in __destruct
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Test
+{
+ function __toString()
+ {
+ return "Hello\n";
+ }
+
+ function __destruct()
+ {
+ echo $this;
+ }
+}
+
+$o = new Test;
+$o = NULL;
+
+$o = new Test;
+
+?>
+====DONE====
+--EXPECTF--
+Hello
+====DONE====
+Hello
diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt
new file mode 100644
index 0000000..8815bd9
--- /dev/null
+++ b/tests/classes/tostring_003.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 __toString() in __destruct/exception
+--FILE--
+<?php
+
+class Test
+{
+ function __toString()
+ {
+ throw new Exception("Damn!");
+ return "Hello\n";
+ }
+
+ function __destruct()
+ {
+ echo $this;
+ }
+}
+
+try
+{
+ $o = new Test;
+ $o = NULL;
+}
+catch(Exception $e)
+{
+ var_dump($e->getMessage());
+}
+
+?>
+====DONE====
+--EXPECTF--
+Fatal error: Method Test::__toString() must not throw an exception in %stostring_003.php on line %d
diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt
new file mode 100644
index 0000000..de0283e
--- /dev/null
+++ b/tests/classes/tostring_004.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Object to string conversion: error cases and behaviour variations.
+--FILE--
+<?php
+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
+ echo "Error: $err_no - $err_msg\n";
+}
+set_error_handler('test_error_handler');
+error_reporting(8191);
+
+
+echo "Object with no __toString():\n";
+$obj = new stdClass;
+echo "Try 1:\n";
+printf($obj);
+printf("\n");
+
+echo "\nTry 2:\n";
+printf($obj . "\n");
+
+
+echo "\n\nObject with bad __toString():\n";
+class badToString {
+ function __toString() {
+ return 0;
+ }
+}
+$obj = new badToString;
+echo "Try 1:\n";
+printf($obj);
+printf("\n");
+
+echo "\nTry 2:\n";
+printf($obj . "\n");
+
+?>
+--EXPECTF--
+Object with no __toString():
+Try 1:
+Error: 4096 - Object of class stdClass could not be converted to string
+Error: 8 - Object of class stdClass to string conversion
+Object
+
+Try 2:
+Error: 4096 - Object of class stdClass could not be converted to string
+
+
+
+Object with bad __toString():
+Try 1:
+Error: 4096 - Method badToString::__toString() must return a string value
+
+
+Try 2:
+Error: 4096 - Method badToString::__toString() must return a string value
+
diff --git a/tests/classes/type_hinting_001.phpt b/tests/classes/type_hinting_001.phpt
new file mode 100644
index 0000000..f55dd53
--- /dev/null
+++ b/tests/classes/type_hinting_001.phpt
@@ -0,0 +1,38 @@
+--TEST--
+ZE2 class type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+interface Foo {
+ function a(Foo $foo);
+}
+
+interface Bar {
+ function b(Bar $bar);
+}
+
+class FooBar implements Foo, Bar {
+ function a(Foo $foo) {
+ // ...
+ }
+
+ function b(Bar $bar) {
+ // ...
+ }
+}
+
+class Blort {
+}
+
+$a = new FooBar;
+$b = new Blort;
+
+$a->a($b);
+$a->b($b);
+
+?>
+--EXPECTF--
+
+Catchable fatal error: Argument 1 passed to FooBar::a() must implement interface Foo, instance of Blort given, called in %s on line 27 and defined in %s on line 12
diff --git a/tests/classes/type_hinting_002.phpt b/tests/classes/type_hinting_002.phpt
new file mode 100644
index 0000000..7c685bf
--- /dev/null
+++ b/tests/classes/type_hinting_002.phpt
@@ -0,0 +1,16 @@
+--TEST--
+ZE2 class type hinting non existing class
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Foo {
+ function a(NonExisting $foo) {}
+}
+
+$o = new Foo;
+$o->a($o);
+?>
+--EXPECTF--
+Catchable fatal error: Argument 1 passed to Foo::a() must be an instance of NonExisting, instance of Foo given, called in %s on line %d and defined in %s on line %d
diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt
new file mode 100644
index 0000000..a966210
--- /dev/null
+++ b/tests/classes/type_hinting_003.phpt
@@ -0,0 +1,60 @@
+--TEST--
+ZE2 class type hinting with arrays
+--FILE--
+<?php
+
+class Test
+{
+ static function f1(array $ar)
+ {
+ echo __METHOD__ . "()\n";
+ var_dump($ar);
+ }
+
+ static function f2(array $ar = NULL)
+ {
+ echo __METHOD__ . "()\n";
+ var_dump($ar);
+ }
+
+ static function f3(array $ar = array())
+ {
+ echo __METHOD__ . "()\n";
+ var_dump($ar);
+ }
+
+ static function f4(array $ar = array(25))
+ {
+ echo __METHOD__ . "()\n";
+ var_dump($ar);
+ }
+}
+
+Test::f1(array(42));
+Test::f2(NULL);
+Test::f2();
+Test::f3();
+Test::f4();
+Test::f1(1);
+
+?>
+--EXPECTF--
+Test::f1()
+array(1) {
+ [0]=>
+ int(42)
+}
+Test::f2()
+NULL
+Test::f2()
+NULL
+Test::f3()
+array(0) {
+}
+Test::f4()
+array(1) {
+ [0]=>
+ int(25)
+}
+
+Catchable fatal error: Argument 1 passed to Test::f1() must be of the type array, integer given, called in %s on line %d and defined in %s on line %d
diff --git a/tests/classes/type_hinting_004.phpt b/tests/classes/type_hinting_004.phpt
new file mode 100644
index 0000000..9068909
--- /dev/null
+++ b/tests/classes/type_hinting_004.phpt
@@ -0,0 +1,109 @@
+--TEST--
+Ensure type hints are enforced for functions invoked as callbacks.
+--FILE--
+<?php
+ set_error_handler('myErrorHandler', E_RECOVERABLE_ERROR);
+ function myErrorHandler($errno, $errstr, $errfile, $errline) {
+ echo "$errno: $errstr - $errfile($errline)\n";
+ return true;
+ }
+
+ echo "---> Type hints with callback function:\n";
+ class A { }
+ function f1(A $a) {
+ echo "in f1;\n";
+ }
+ function f2(A $a = null) {
+ echo "in f2;\n";
+ }
+ call_user_func('f1', 1);
+ call_user_func('f1', new A);
+ call_user_func('f2', 1);
+ call_user_func('f2');
+ call_user_func('f2', new A);
+ call_user_func('f2', null);
+
+
+ echo "\n\n---> Type hints with callback static method:\n";
+ class C {
+ static function f1(A $a) {
+ if (isset($this)) {
+ echo "in C::f1 (instance);\n";
+ } else {
+ echo "in C::f1 (static);\n";
+ }
+ }
+ static function f2(A $a = null) {
+ if (isset($this)) {
+ echo "in C::f2 (instance);\n";
+ } else {
+ echo "in C::f2 (static);\n";
+ }
+ }
+ }
+ call_user_func(array('C', 'f1'), 1);
+ call_user_func(array('C', 'f1'), new A);
+ call_user_func(array('C', 'f2'), 1);
+ call_user_func(array('C', 'f2'));
+ call_user_func(array('C', 'f2'), new A);
+ call_user_func(array('C', 'f2'), null);
+
+
+ echo "\n\n---> Type hints with callback instance method:\n";
+ class D {
+ function f1(A $a) {
+ if (isset($this)) {
+ echo "in C::f1 (instance);\n";
+ } else {
+ echo "in C::f1 (static);\n";
+ }
+ }
+ function f2(A $a = null) {
+ if (isset($this)) {
+ echo "in C::f2 (instance);\n";
+ } else {
+ echo "in C::f2 (static);\n";
+ }
+ }
+ }
+ $d = new D;
+ call_user_func(array($d, 'f1'), 1);
+ call_user_func(array($d, 'f1'), new A);
+ call_user_func(array($d, 'f2'), 1);
+ call_user_func(array($d, 'f2'));
+ call_user_func(array($d, 'f2'), new A);
+ call_user_func(array($d, 'f2'), null);
+
+?>
+--EXPECTF--
+---> Type hints with callback function:
+4096: Argument 1 passed to f1() must be an instance of A, integer given%s(10)
+in f1;
+in f1;
+4096: Argument 1 passed to f2() must be an instance of A, integer given%s(13)
+in f2;
+in f2;
+in f2;
+in f2;
+
+
+---> Type hints with callback static method:
+4096: Argument 1 passed to C::f1() must be an instance of A, integer given%s(26)
+in C::f1 (static);
+in C::f1 (static);
+4096: Argument 1 passed to C::f2() must be an instance of A, integer given%s(33)
+in C::f2 (static);
+in C::f2 (static);
+in C::f2 (static);
+in C::f2 (static);
+
+
+---> Type hints with callback instance method:
+4096: Argument 1 passed to D::f1() must be an instance of A, integer given%s(51)
+in C::f1 (instance);
+in C::f1 (instance);
+4096: Argument 1 passed to D::f2() must be an instance of A, integer given%s(58)
+in C::f2 (instance);
+in C::f2 (instance);
+in C::f2 (instance);
+in C::f2 (instance);
diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt
new file mode 100644
index 0000000..5e4c43b
--- /dev/null
+++ b/tests/classes/type_hinting_005a.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Check type hint compatibility in overrides with array hints.
+--FILE--
+<?php
+Class C { function f(array $a) {} }
+
+echo "Compatible hint.\n";
+Class D1 extends C { function f(array $a) {} }
+
+echo "Class hint, should be array.\n";
+Class D2 extends C { function f(SomeClass $a) {} }
+?>
+==DONE==
+--EXPECTF--
+Strict Standards: Declaration of D2::f() should be compatible with C::f(array $a) in %s on line 8
+Compatible hint.
+Class hint, should be array.
+==DONE==
diff --git a/tests/classes/type_hinting_005b.phpt b/tests/classes/type_hinting_005b.phpt
new file mode 100644
index 0000000..f13ab95
--- /dev/null
+++ b/tests/classes/type_hinting_005b.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Check type hint compatibility in overrides with array hints.
+--FILE--
+<?php
+Class C { function f(array $a) {} }
+
+echo "No hint, should be array.\n";
+Class D extends C { function f($a) {} }
+?>
+==DONE==
+--EXPECTF--
+Strict Standards: Declaration of D::f() should be compatible with C::f(array $a) in %s on line 5
+No hint, should be array.
+==DONE==
diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt
new file mode 100644
index 0000000..30a114e
--- /dev/null
+++ b/tests/classes/type_hinting_005c.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Check type hint compatibility in overrides with array hints.
+--FILE--
+<?php
+Class C { function f(SomeClass $a) {} }
+
+echo "Array hint, should be class.\n";
+Class D extends C { function f(array $a) {} }
+?>
+==DONE==
+--EXPECTF--
+Strict Standards: Declaration of D::f() should be compatible with C::f(SomeClass $a) in %s on line 5
+Array hint, should be class.
+==DONE==
diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt
new file mode 100644
index 0000000..830054d
--- /dev/null
+++ b/tests/classes/type_hinting_005d.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Check type hint compatibility in overrides with array hints.
+--FILE--
+<?php
+Class C { function f($a) {} }
+
+echo "Array hint, should be nothing.\n";
+Class D extends C { function f(array $a) {} }
+?>
+==DONE==
+--EXPECTF--
+Strict Standards: Declaration of D::f() should be compatible with C::f($a) in %s on line 5
+Array hint, should be nothing.
+==DONE==
diff --git a/tests/classes/unset_properties.phpt b/tests/classes/unset_properties.phpt
new file mode 100644
index 0000000..264e720
--- /dev/null
+++ b/tests/classes/unset_properties.phpt
@@ -0,0 +1,154 @@
+--TEST--
+Un-setting instance properties causes magic methods to be called when trying to access them from outside the magic
+methods themselves.
+--FILE--
+<?php
+
+class Test
+{
+ public $publicProperty = 'publicProperty set';
+
+ protected $protectedProperty = 'protectedProperty set';
+
+ private $privateProperty = 'privateProperty set';
+
+ public function __get($name)
+ {
+ return '__get "' . $name . '"';
+ }
+
+ public function __set($name, $value)
+ {
+ $this->$name = $value;
+ echo '__set "' . $name . '" to "' . $value . '"';
+ }
+
+ public function __isset($name)
+ {
+ echo '__isset "' . $name . '"';
+ return isset($this->$name);
+ }
+
+ public function getPublicProperty()
+ {
+ return $this->publicProperty;
+ }
+
+ public function setPublicProperty($publicProperty)
+ {
+ $this->publicProperty = $publicProperty;
+ }
+
+ public function unsetProtectedProperty()
+ {
+ unset($this->protectedProperty);
+ }
+
+ public function getProtectedProperty()
+ {
+ return $this->protectedProperty;
+ }
+
+ public function setProtectedProperty($protectedProperty)
+ {
+ $this->protectedProperty = $protectedProperty;
+ }
+
+ public function unsetPrivateProperty()
+ {
+ unset($this->privateProperty);
+ }
+
+ public function getPrivateProperty()
+ {
+ return $this->privateProperty;
+ }
+
+ public function setPrivateProperty($privateProperty)
+ {
+ $this->privateProperty = $privateProperty;
+ }
+}
+
+// verifying public property
+$o = new Test;
+echo $o->publicProperty;
+echo "\n";
+var_export(isset($o->publicProperty));
+echo "\n";
+unset($o->publicProperty);
+isset($o->publicProperty);
+echo "\n";
+echo $o->publicProperty;
+echo "\n";
+echo $o->getPublicProperty();
+echo "\n";
+echo $o->setPublicProperty('new publicProperty value via setter');
+echo "\n";
+echo $o->publicProperty;
+echo "\n";
+unset($o->publicProperty);
+$o->publicProperty = 'new publicProperty value via public access';
+echo "\n";
+var_export(isset($o->publicProperty));
+echo "\n";
+echo $o->publicProperty;
+echo "\n\n";
+
+// verifying protected property
+echo $o->getProtectedProperty();
+echo "\n";
+$o->unsetProtectedProperty();
+var_export(isset($o->protectedProperty));
+echo "\n";
+echo $o->getProtectedProperty();
+echo "\n";
+echo $o->setProtectedProperty('new protectedProperty value via setter');
+echo "\n";
+var_export(isset($o->protectedProperty));
+echo "\n";
+echo $o->getProtectedProperty();
+echo "\n\n";
+
+// verifying private property
+echo $o->getPrivateProperty();
+echo "\n";
+$o->unsetPrivateProperty();
+var_export(isset($o->privateProperty));
+echo "\n";
+echo $o->getPrivateProperty();
+echo "\n";
+echo $o->setPrivateProperty('new privateProperty value via setter');
+echo "\n";
+var_export(isset($o->privateProperty));
+echo "\n";
+echo $o->getPrivateProperty();
+echo "\n\n";
+
+?>
+
+--EXPECTF--
+publicProperty set
+true
+__isset "publicProperty"
+__get "publicProperty"
+__get "publicProperty"
+__set "publicProperty" to "new publicProperty value via setter"
+new publicProperty value via setter
+__set "publicProperty" to "new publicProperty value via public access"
+true
+new publicProperty value via public access
+
+protectedProperty set
+__isset "protectedProperty"false
+__get "protectedProperty"
+__set "protectedProperty" to "new protectedProperty value via setter"
+__isset "protectedProperty"true
+new protectedProperty value via setter
+
+privateProperty set
+__isset "privateProperty"false
+__get "privateProperty"
+__set "privateProperty" to "new privateProperty value via setter"
+__isset "privateProperty"true
+new privateProperty value via setter
diff --git a/tests/classes/visibility_000a.phpt b/tests/classes/visibility_000a.phpt
new file mode 100644
index 0000000..2524494
--- /dev/null
+++ b/tests/classes/visibility_000a.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ protected function f0() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d
diff --git a/tests/classes/visibility_000b.phpt b/tests/classes/visibility_000b.phpt
new file mode 100644
index 0000000..9305467
--- /dev/null
+++ b/tests/classes/visibility_000b.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ private function f0() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f0() must be public (as in class same) in %s on line %d
diff --git a/tests/classes/visibility_000c.phpt b/tests/classes/visibility_000c.phpt
new file mode 100644
index 0000000..064106e
--- /dev/null
+++ b/tests/classes/visibility_000c.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ function f0() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_001a.phpt b/tests/classes/visibility_001a.phpt
new file mode 100644
index 0000000..ebd1cc3
--- /dev/null
+++ b/tests/classes/visibility_001a.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ protected function f1() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d
diff --git a/tests/classes/visibility_001b.phpt b/tests/classes/visibility_001b.phpt
new file mode 100644
index 0000000..e61078e
--- /dev/null
+++ b/tests/classes/visibility_001b.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ private function f1() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f1() must be public (as in class same) in %s on line %d
diff --git a/tests/classes/visibility_001c.phpt b/tests/classes/visibility_001c.phpt
new file mode 100644
index 0000000..bb1075a
--- /dev/null
+++ b/tests/classes/visibility_001c.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ function f1() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_002a.phpt b/tests/classes/visibility_002a.phpt
new file mode 100644
index 0000000..6c88d20
--- /dev/null
+++ b/tests/classes/visibility_002a.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ protected function f2() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d
diff --git a/tests/classes/visibility_002b.phpt b/tests/classes/visibility_002b.phpt
new file mode 100644
index 0000000..71f47c3
--- /dev/null
+++ b/tests/classes/visibility_002b.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ private function f2() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f2() must be public (as in class same) in %s on line %d
diff --git a/tests/classes/visibility_002c.phpt b/tests/classes/visibility_002c.phpt
new file mode 100644
index 0000000..5edae1d
--- /dev/null
+++ b/tests/classes/visibility_002c.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ function f2() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_003a.phpt b/tests/classes/visibility_003a.phpt
new file mode 100644
index 0000000..1693386
--- /dev/null
+++ b/tests/classes/visibility_003a.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ public function f3() {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_003b.phpt b/tests/classes/visibility_003b.phpt
new file mode 100644
index 0000000..fcfdbe3
--- /dev/null
+++ b/tests/classes/visibility_003b.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ private function f3() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Fatal error: Access level to fail::f3() must be protected (as in class same) or weaker in %s on line %d
diff --git a/tests/classes/visibility_003c.phpt b/tests/classes/visibility_003c.phpt
new file mode 100644
index 0000000..d94a9c1
--- /dev/null
+++ b/tests/classes/visibility_003c.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ function f3() {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_004a.phpt b/tests/classes/visibility_004a.phpt
new file mode 100644
index 0000000..6f16a09
--- /dev/null
+++ b/tests/classes/visibility_004a.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ public function f4() {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_004b.phpt b/tests/classes/visibility_004b.phpt
new file mode 100644
index 0000000..74a8318
--- /dev/null
+++ b/tests/classes/visibility_004b.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ protected function f4() {}
+}
+
+echo "Done\n"; // shouldn't be displayed
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_004c.phpt b/tests/classes/visibility_004c.phpt
new file mode 100644
index 0000000..92a7703
--- /dev/null
+++ b/tests/classes/visibility_004c.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ZE2 A redeclared method must have the same or higher visibility
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class father {
+ function f0() {}
+ function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class same extends father {
+
+ // overload fn with same visibility
+ function f0() {}
+ public function f1() {}
+ public function f2() {}
+ protected function f3() {}
+ private function f4() {}
+}
+
+class fail extends same {
+ function f4() {}
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Done
diff --git a/tests/classes/visibility_005.phpt b/tests/classes/visibility_005.phpt
new file mode 100644
index 0000000..859a5f7
--- /dev/null
+++ b/tests/classes/visibility_005.phpt
@@ -0,0 +1,59 @@
+--TEST--
+ZE2 foreach and property visibility
+--FILE--
+<?php
+
+class base
+{
+ public $a=1;
+ protected $b=2;
+ private $c=3;
+
+ function f()
+ {
+ foreach($this as $k=>$v) {
+ echo "$k=>$v\n";
+ }
+ }
+}
+
+class derived extends base
+{
+}
+
+$o = new base;
+$o->d = 4;
+echo "===base::function===\n";
+$o->f();
+echo "===base,foreach===\n";
+foreach($o as $k=>$v) {
+ echo "$k=>$v\n";
+}
+
+$o = new derived;
+$o->d = 4;
+echo "===derived::function===\n";
+$o->f();
+echo "===derived,foreach===\n";
+foreach($o as $k=>$v) {
+ echo "$k=>$v\n";
+}
+
+?>
+--EXPECT--
+===base::function===
+a=>1
+b=>2
+c=>3
+d=>4
+===base,foreach===
+a=>1
+d=>4
+===derived::function===
+a=>1
+b=>2
+c=>3
+d=>4
+===derived,foreach===
+a=>1
+d=>4
diff --git a/tests/func/001.phpt b/tests/func/001.phpt
new file mode 100644
index 0000000..d080406
--- /dev/null
+++ b/tests/func/001.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Strlen() function test
+--FILE--
+<?php echo strlen("abcdef")?>
+--EXPECT--
+6
diff --git a/tests/func/002.phpt b/tests/func/002.phpt
new file mode 100644
index 0000000..cb35f92
--- /dev/null
+++ b/tests/func/002.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Static variables in functions
+--FILE--
+<?php
+function blah()
+{
+ static $hey=0,$yo=0;
+
+ echo "hey=".$hey++.", ",$yo--."\n";
+}
+
+blah();
+blah();
+blah();
+if (isset($hey) || isset($yo)) {
+ echo "Local variables became global :(\n";
+}
+--EXPECT--
+hey=0, 0
+hey=1, -1
+hey=2, -2
diff --git a/tests/func/003.phpt b/tests/func/003.phpt
new file mode 100644
index 0000000..d603784
--- /dev/null
+++ b/tests/func/003.phpt
@@ -0,0 +1,291 @@
+--TEST--
+General function test
+--FILE--
+<?php
+
+function a()
+{
+ echo "hey\n";
+}
+
+function b($i)
+{
+ echo "$i\n";
+}
+
+
+function c($i,$j)
+{
+ echo "Counting from $i to $j\n";
+ for ($k=$i; $k<=$j; $k++) {
+ echo "$k\n";
+ }
+}
+
+
+
+a();
+b("blah");
+a();
+b("blah","blah");
+c(7,14);
+
+a();
+
+
+function factorial($n)
+{
+ if ($n==0 || $n==1) {
+ return 1;
+ } else {
+ return factorial($n-1)*$n;
+ }
+}
+
+
+function factorial2($start, $n)
+{
+ if ($n<=$start) {
+ return $start;
+ } else {
+ return factorial2($start,$n-1)*$n;
+ }
+}
+
+
+for ($k=0; $k<10; $k++) {
+ for ($i=0; $i<=10; $i++) {
+ $n=factorial($i);
+ echo "factorial($i) = $n\n";
+ }
+}
+
+
+echo "and now, from a function...\n";
+
+function call_fact()
+{
+ echo "(it should break at 5...)\n";
+ for ($i=0; $i<=10; $i++) {
+ if ($i == 5) break;
+ $n=factorial($i);
+ echo "factorial($i) = $n\n";
+ }
+}
+
+function return4() { return 4; }
+function return7() { return 7; }
+
+for ($k=0; $k<10; $k++) {
+ call_fact();
+}
+
+echo "------\n";
+$result = factorial(factorial(3));
+echo "$result\n";
+
+$result=factorial2(return4(),return7());
+echo "$result\n";
+
+function andi($i, $j)
+{
+ for ($k=$i ; $k<=$j ; $k++) {
+ if ($k >5) continue;
+ echo "$k\n";
+ }
+}
+
+andi (3,10);
+--EXPECT--
+hey
+blah
+hey
+blah
+Counting from 7 to 14
+7
+8
+9
+10
+11
+12
+13
+14
+hey
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+factorial(5) = 120
+factorial(6) = 720
+factorial(7) = 5040
+factorial(8) = 40320
+factorial(9) = 362880
+factorial(10) = 3628800
+and now, from a function...
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+(it should break at 5...)
+factorial(0) = 1
+factorial(1) = 1
+factorial(2) = 2
+factorial(3) = 6
+factorial(4) = 24
+------
+720
+840
+3
+4
+5
+
diff --git a/tests/func/004.phpt b/tests/func/004.phpt
new file mode 100644
index 0000000..1434297
--- /dev/null
+++ b/tests/func/004.phpt
@@ -0,0 +1,65 @@
+--TEST--
+General function test
+--FILE--
+<?php
+
+echo "Before function declaration...\n";
+
+function print_something_multiple_times($something,$times)
+{
+ echo "----\nIn function, printing the string \"$something\" $times times\n";
+ for ($i=0; $i<$times; $i++) {
+ echo "$i) $something\n";
+ }
+ echo "Done with function...\n-----\n";
+}
+
+function some_other_function()
+{
+ echo "This is some other function, to ensure more than just one function works fine...\n";
+}
+
+
+echo "After function declaration...\n";
+
+echo "Calling function for the first time...\n";
+print_something_multiple_times("This works!",10);
+echo "Returned from function call...\n";
+
+echo "Calling the function for the second time...\n";
+print_something_multiple_times("This like, really works and stuff...",3);
+echo "Returned from function call...\n";
+
+some_other_function();
+
+?>
+--EXPECT--
+
+Before function declaration...
+After function declaration...
+Calling function for the first time...
+----
+In function, printing the string "This works!" 10 times
+0) This works!
+1) This works!
+2) This works!
+3) This works!
+4) This works!
+5) This works!
+6) This works!
+7) This works!
+8) This works!
+9) This works!
+Done with function...
+-----
+Returned from function call...
+Calling the function for the second time...
+----
+In function, printing the string "This like, really works and stuff..." 3 times
+0) This like, really works and stuff...
+1) This like, really works and stuff...
+2) This like, really works and stuff...
+Done with function...
+-----
+Returned from function call...
+This is some other function, to ensure more than just one function works fine...
diff --git a/tests/func/005.phpt b/tests/func/005.phpt
new file mode 100644
index 0000000..c4215fe
--- /dev/null
+++ b/tests/func/005.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Testing register_shutdown_function()
+--FILE--
+<?php
+
+function foo()
+{
+ print "foo";
+}
+
+register_shutdown_function("foo");
+
+print "foo() will be called on shutdown...\n";
+
+?>
+--EXPECT--
+foo() will be called on shutdown...
+foo
+
diff --git a/tests/func/005a.phpt b/tests/func/005a.phpt
new file mode 100644
index 0000000..3c2bcb1
--- /dev/null
+++ b/tests/func/005a.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Testing register_shutdown_function() with timeout. (Bug: #21513)
+--SKIPIF--
+<?php
+if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+?>
+--FILE--
+<?php
+
+ini_set('display_errors', 0);
+
+echo "Start\n";
+
+function boo()
+{
+ echo "Shutdown\n";
+}
+
+register_shutdown_function("boo");
+
+/* not necessary, just to show the error sooner */
+set_time_limit(1);
+
+/* infinite loop to simulate long processing */
+for (;;) {}
+
+echo "End\n";
+
+?>
+--EXPECT--
+Start
+Shutdown
diff --git a/tests/func/006.phpt b/tests/func/006.phpt
new file mode 100644
index 0000000..077b6f8
--- /dev/null
+++ b/tests/func/006.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Output buffering tests
+--INI--
+output_buffering=0
+output_handler=
+zlib.output_compression=0
+zlib.output_handler=
+--FILE--
+<?php
+ob_start();
+echo ob_get_level();
+echo 'A';
+ ob_start();
+ echo ob_get_level();
+ echo 'B';
+ $b = ob_get_contents();
+ ob_end_clean();
+$a = ob_get_contents();
+ob_end_clean();
+
+var_dump( $b ); // 2B
+var_dump( $a ); // 1A
+?>
+--EXPECT--
+string(2) "2B"
+string(2) "1A"
diff --git a/tests/func/007.phpt b/tests/func/007.phpt
new file mode 100644
index 0000000..73aae2e
--- /dev/null
+++ b/tests/func/007.phpt
@@ -0,0 +1,22 @@
+--TEST--
+INI functions test
+--FILE--
+<?php
+
+$ini1 = ini_get('include_path');
+ini_set('include_path','ini_set_works');
+echo ini_get('include_path')."\n";
+ini_restore('include_path');
+$ini2 = ini_get('include_path');
+
+if ($ini1 !== $ini2) {
+ echo "ini_restore() does not work.\n";
+}
+else {
+ echo "ini_restore_works\n";
+}
+
+?>
+--EXPECT--
+ini_set_works
+ini_restore_works
diff --git a/tests/func/008.phpt b/tests/func/008.phpt
new file mode 100644
index 0000000..48098e1
--- /dev/null
+++ b/tests/func/008.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Test for buffering in core functions with implicit flush off
+--INI--
+implicit_flush=0
+--FILE--
+<?php
+$res = var_export("foo1");
+echo "\n";
+$res = var_export("foo2", TRUE);
+echo "\n";
+echo $res."\n";
+?>
+--EXPECT--
+'foo1'
+
+'foo2'
diff --git a/tests/func/009.phpt b/tests/func/009.phpt
new file mode 100644
index 0000000..05b40e8
--- /dev/null
+++ b/tests/func/009.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Test for buffering in core functions with implicit flush on
+--INI--
+implicit_flush=1
+--FILE--
+<?php
+$res = var_export("foo1");
+echo "\n";
+$res = var_export("foo2", TRUE);
+echo "\n";
+echo $res."\n";
+?>
+--EXPECT--
+'foo1'
+
+'foo2'
diff --git a/tests/func/010.phpt b/tests/func/010.phpt
new file mode 100644
index 0000000..f970283
--- /dev/null
+++ b/tests/func/010.phpt
@@ -0,0 +1,77 @@
+--TEST--
+function with many parameters
+--SKIPIF--
+<?php
+if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+?>
+--FILE--
+<?php
+
+// the stack size + some random constant
+$boundary = 64*1024;
+$limit = $boundary+42;
+
+
+function test($a,$b)
+{
+ var_dump($a === $b);
+ test2($a,$b);
+}
+
+function test2($a, $b)
+{
+ if ($a !== $b) {
+ var_dump("something went wrong: $a !== $b");
+ }
+}
+
+
+// generate the function
+$str = "<?php\nfunction x(";
+
+for($i=0; $i < $limit; ++$i) {
+ $str .= '$v'.dechex($i).($i===($limit-1) ? '' : ',');
+}
+
+$str .= ') {
+ test($v42, \'42\');
+ test(\'4000\', $v4000);
+ test2($v300, \'300\');
+ test($v0, \'0\'); // first
+ test($v'.dechex($limit-1).", '".dechex($limit-1).'\'); // last
+ test($v'.dechex($boundary).", '".dechex($boundary).'\'); //boundary
+ test($v'.dechex($boundary+1).", '".dechex($boundary+1).'\'); //boundary+1
+ test($v'.dechex($boundary-1).", '".dechex($boundary-1).'\'); //boundary-1
+}';
+
+// generate the function call
+$str .= "\n\nx(";
+
+for($i=0; $i< $limit; ++$i) {
+ $str .= "'".dechex($i)."'".($i===($limit-1) ? '' : ',');
+}
+
+$str .= ");\n";
+
+$filename = dirname(__FILE__).'/010-file.php';
+file_put_contents(dirname(__FILE__).'/010-file.php', $str);
+unset($str);
+
+include($filename);
+
+echo "Done\n";
+
+?>
+--CLEAN--
+<?php
+@unlink(dirname(__FILE__).'/010-file.php');
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+Done
diff --git a/tests/func/ini_alter.phpt b/tests/func/ini_alter.phpt
new file mode 100644
index 0000000..111e826
--- /dev/null
+++ b/tests/func/ini_alter.phpt
@@ -0,0 +1,19 @@
+--TEST--
+ini_alter() check
+--CREDITS--
+Sebastian SchÃŒrmann
+sebs@php.net
+Testfest 2009 Munich
+--FILE--
+<?php
+ini_alter('error_reporting', 1);
+$var = ini_get('error_reporting');
+var_dump($var);
+ini_alter('error_reporting', 0);
+$var = ini_get('error_reporting');
+var_dump($var);
+?>
+--EXPECT--
+string(1) "1"
+string(1) "0"
+
diff --git a/tests/lang/001.phpt b/tests/lang/001.phpt
new file mode 100644
index 0000000..71df318
--- /dev/null
+++ b/tests/lang/001.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Simple If condition test
+--FILE--
+<?php $a=1; if($a>0) { echo "Yes"; } ?>
+--EXPECT--
+Yes
diff --git a/tests/lang/002.phpt b/tests/lang/002.phpt
new file mode 100644
index 0000000..ec14d01
--- /dev/null
+++ b/tests/lang/002.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Simple While Loop Test
+--FILE--
+<?php
+$a=1;
+while ($a<10) {
+ echo $a;
+ $a++;
+}
+?>
+--EXPECT--
+123456789
diff --git a/tests/lang/003.phpt b/tests/lang/003.phpt
new file mode 100644
index 0000000..7049db9
--- /dev/null
+++ b/tests/lang/003.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Simple Switch Test
+--FILE--
+<?php
+$a=1;
+switch($a) {
+ case 0:
+ echo "bad";
+ break;
+ case 1:
+ echo "good";
+ break;
+ default:
+ echo "bad";
+ break;
+}
+?>
+--EXPECT--
+good
diff --git a/tests/lang/004.phpt b/tests/lang/004.phpt
new file mode 100644
index 0000000..be8ebf4
--- /dev/null
+++ b/tests/lang/004.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Simple If/Else Test
+--FILE--
+<?php
+$a=1;
+if($a==0) {
+ echo "bad";
+} else {
+ echo "good";
+}
+?>
+--EXPECT--
+good
diff --git a/tests/lang/005.phpt b/tests/lang/005.phpt
new file mode 100644
index 0000000..404a7cb
--- /dev/null
+++ b/tests/lang/005.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Simple If/ElseIf/Else Test
+--FILE--
+<?php
+$a=1;
+
+if($a==0) {
+ echo "bad";
+} elseif($a==3) {
+ echo "bad";
+} else {
+ echo "good";
+}
+?>
+--EXPECT--
+good
diff --git a/tests/lang/006.phpt b/tests/lang/006.phpt
new file mode 100644
index 0000000..2a2db01
--- /dev/null
+++ b/tests/lang/006.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Nested If/ElseIf/Else Test
+--FILE--
+<?php
+$a=1;
+$b=2;
+
+if($a==0) {
+ echo "bad";
+} elseif($a==3) {
+ echo "bad";
+} else {
+ if($b==1) {
+ echo "bad";
+ } elseif($b==2) {
+ echo "good";
+ } else {
+ echo "bad";
+ }
+}
+?>
+--EXPECT--
+good
diff --git a/tests/lang/007.phpt b/tests/lang/007.phpt
new file mode 100644
index 0000000..4576d4e
--- /dev/null
+++ b/tests/lang/007.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Function call with global and static variables
+--FILE--
+<?php
+error_reporting(0);
+$a = 10;
+
+function Test()
+{
+ static $a=1;
+ global $b;
+ $c = 1;
+ $b = 5;
+ echo "$a $b ";
+ $a++;
+ $c++;
+ echo "$a $c ";
+}
+
+Test();
+echo "$a $b $c ";
+Test();
+echo "$a $b $c ";
+Test();
+?>
+--EXPECT--
+1 5 2 2 10 5 2 5 3 2 10 5 3 5 4 2
diff --git a/tests/lang/008.phpt b/tests/lang/008.phpt
new file mode 100644
index 0000000..d335e6f
--- /dev/null
+++ b/tests/lang/008.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Testing recursive function
+--FILE--
+<?php
+
+function Test()
+{
+ static $a=1;
+ echo "$a ";
+ $a++;
+ if($a<10): Test(); endif;
+}
+
+Test();
+
+?>
+--EXPECT--
+1 2 3 4 5 6 7 8 9
diff --git a/tests/lang/009.phpt b/tests/lang/009.phpt
new file mode 100644
index 0000000..ea2aa92
--- /dev/null
+++ b/tests/lang/009.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Testing function parameter passing
+--FILE--
+<?php
+function test ($a,$b) {
+ echo $a+$b;
+}
+test(1,2);
+?>
+--EXPECT--
+3
diff --git a/tests/lang/010.phpt b/tests/lang/010.phpt
new file mode 100644
index 0000000..603abe3
--- /dev/null
+++ b/tests/lang/010.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing function parameter passing with a return value
+--FILE--
+<?php
+function test ($b) {
+ $b++;
+ return($b);
+}
+$a = test(1);
+echo $a;
+?>
+--EXPECT--
+2
diff --git a/tests/lang/011.phpt b/tests/lang/011.phpt
new file mode 100644
index 0000000..771ef7c
--- /dev/null
+++ b/tests/lang/011.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Testing nested functions
+--FILE--
+<?php
+function F()
+{
+ $a = "Hello ";
+ return($a);
+}
+
+function G()
+{
+ static $myvar = 4;
+
+ echo "$myvar ";
+ echo F();
+ echo "$myvar";
+}
+
+G();
+?>
+--EXPECT--
+4 Hello 4
diff --git a/tests/lang/012.phpt b/tests/lang/012.phpt
new file mode 100644
index 0000000..117137a
--- /dev/null
+++ b/tests/lang/012.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Testing stack after early function return
+--FILE--
+<?php
+function F () {
+ if(1) {
+ return("Hello");
+ }
+}
+
+$i=0;
+while ($i<2) {
+ echo F();
+ $i++;
+}
+?>
+--EXPECT--
+HelloHello
diff --git a/tests/lang/013.phpt b/tests/lang/013.phpt
new file mode 100644
index 0000000..be84cdc
--- /dev/null
+++ b/tests/lang/013.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Testing eval function
+--FILE--
+<?php
+error_reporting(0);
+$a="echo \"Hello\";";
+eval($a);
+?>
+--EXPECT--
+Hello
diff --git a/tests/lang/014.phpt b/tests/lang/014.phpt
new file mode 100644
index 0000000..f0033b2
--- /dev/null
+++ b/tests/lang/014.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing eval function inside user-defined function
+--FILE--
+<?php
+function F ($a) {
+ eval($a);
+}
+
+error_reporting(0);
+F("echo \"Hello\";");
+?>
+--EXPECT--
+Hello
diff --git a/tests/lang/015.inc b/tests/lang/015.inc
new file mode 100644
index 0000000..d436a7b
--- /dev/null
+++ b/tests/lang/015.inc
@@ -0,0 +1,3 @@
+<?php
+ echo "Hello";
+?>
diff --git a/tests/lang/015.phpt b/tests/lang/015.phpt
new file mode 100644
index 0000000..952e7f1
--- /dev/null
+++ b/tests/lang/015.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Testing include
+--FILE--
+<?php
+include "015.inc";
+?>
+--EXPECT--
+Hello
diff --git a/tests/lang/016.inc b/tests/lang/016.inc
new file mode 100644
index 0000000..b73333f
--- /dev/null
+++ b/tests/lang/016.inc
@@ -0,0 +1,5 @@
+<?php
+function MyFunc ($a) {
+ echo $a;
+}
+?>
diff --git a/tests/lang/016.phpt b/tests/lang/016.phpt
new file mode 100644
index 0000000..dbaa908
--- /dev/null
+++ b/tests/lang/016.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Testing user-defined function in included file
+--FILE--
+<?php
+include "016.inc";
+MyFunc("Hello");
+?>
+--EXPECT--
+Hello
diff --git a/tests/lang/017.phpt b/tests/lang/017.phpt
new file mode 100644
index 0000000..fb90964
--- /dev/null
+++ b/tests/lang/017.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Testing user-defined function falling out of an If into another
+--FILE--
+<?php
+$a = 1;
+function Test ($a) {
+ if ($a<3) {
+ return(3);
+ }
+}
+
+if ($a < Test($a)) {
+ echo "$a\n";
+ $a++;
+}
+?>
+--EXPECT--
+1
diff --git a/tests/lang/018.phpt b/tests/lang/018.phpt
new file mode 100644
index 0000000..638b131
--- /dev/null
+++ b/tests/lang/018.phpt
@@ -0,0 +1,34 @@
+--TEST--
+eval() test
+--FILE--
+<?php
+
+error_reporting(0);
+
+$message = "echo \"hey\n\";";
+
+for ($i=0; $i<10; $i++) {
+ eval($message);
+ echo $i."\n";
+}
+--EXPECT--
+hey
+0
+hey
+1
+hey
+2
+hey
+3
+hey
+4
+hey
+5
+hey
+6
+hey
+7
+hey
+8
+hey
+9
diff --git a/tests/lang/019.phpt b/tests/lang/019.phpt
new file mode 100644
index 0000000..c9b5e5f
--- /dev/null
+++ b/tests/lang/019.phpt
@@ -0,0 +1,38 @@
+--TEST--
+eval() test
+--FILE--
+<?php
+
+eval("function test() { echo \"hey, this is a function inside an eval()!\\n\"; }");
+
+$i=0;
+while ($i<10) {
+ eval("echo \"hey, this is a regular echo'd eval()\\n\";");
+ test();
+ $i++;
+}
+
+eval('-');
+--EXPECTF--
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+hey, this is a regular echo'd eval()
+hey, this is a function inside an eval()!
+
+Parse error: syntax error, unexpected %s in %s019.php(12) : eval()'d code on line 1
diff --git a/tests/lang/020.phpt b/tests/lang/020.phpt
new file mode 100644
index 0000000..46a2a2c
--- /dev/null
+++ b/tests/lang/020.phpt
@@ -0,0 +1,76 @@
+--TEST--
+Switch test 1
+--FILE--
+<?php
+
+$i="abc";
+
+for ($j=0; $j<10; $j++) {
+switch (1) {
+ case 1:
+ echo "In branch 1\n";
+ switch ($i) {
+ case "ab":
+ echo "This doesn't work... :(\n";
+ break;
+ case "abcd":
+ echo "This works!\n";
+ break;
+ case "blah":
+ echo "Hmmm, no worki\n";
+ break;
+ default:
+ echo "Inner default...\n";
+ }
+ for ($blah=0; $blah<200; $blah++) {
+ if ($blah==100) {
+ echo "blah=$blah\n";
+ }
+ }
+ break;
+ case 2:
+ echo "In branch 2\n";
+ break;
+ case $i:
+ echo "In branch \$i\n";
+ break;
+ case 4:
+ echo "In branch 4\n";
+ break;
+ default:
+ echo "Hi, I'm default\n";
+ break;
+ }
+}
+?>
+--EXPECT--
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
+In branch 1
+Inner default...
+blah=100
diff --git a/tests/lang/021.phpt b/tests/lang/021.phpt
new file mode 100644
index 0000000..aff45b6
--- /dev/null
+++ b/tests/lang/021.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Switch test 2
+--FILE--
+<?php
+
+for ($i=0; $i<=5; $i++)
+{
+ echo "i=$i\n";
+
+ switch($i) {
+ case 0:
+ echo "In branch 0\n";
+ break;
+ case 1:
+ echo "In branch 1\n";
+ break;
+ case 2:
+ echo "In branch 2\n";
+ break;
+ case 3:
+ echo "In branch 3\n";
+ break 2;
+ case 4:
+ echo "In branch 4\n";
+ break;
+ default:
+ echo "In default\n";
+ break;
+ }
+}
+echo "hi\n";
+?>
+--EXPECT--
+i=0
+In branch 0
+i=1
+In branch 1
+i=2
+In branch 2
+i=3
+In branch 3
+hi
diff --git a/tests/lang/022.phpt b/tests/lang/022.phpt
new file mode 100644
index 0000000..dddc6c2
--- /dev/null
+++ b/tests/lang/022.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Switch test 3
+--FILE--
+<?php
+
+function switchtest ($i, $j)
+{
+ switch ($i) {
+ case 0:
+ switch($j) {
+ case 0:
+ echo "zero";
+ break;
+ case 1:
+ echo "one";
+ break;
+ default:
+ echo $j;
+ break;
+ }
+ echo "\n";
+ break;
+ default:
+ echo "Default taken\n";
+ }
+}
+for ($i=0; $i<3; $i++) {
+ for ($k=0; $k<10; $k++) {
+ switchtest (0,$k);
+ }
+}
+?>
+--EXPECT--
+zero
+one
+2
+3
+4
+5
+6
+7
+8
+9
+zero
+one
+2
+3
+4
+5
+6
+7
+8
+9
+zero
+one
+2
+3
+4
+5
+6
+7
+8
+9
diff --git a/tests/lang/023-1.inc b/tests/lang/023-1.inc
new file mode 100644
index 0000000..8d52e84
--- /dev/null
+++ b/tests/lang/023-1.inc
@@ -0,0 +1,356 @@
+<html>
+<head>
+<?php
+/* the point of this file is to intensively test various aspects of
+ * the parser. right now, each test focuses in one aspect only
+ * (e.g. variable aliasing, arithemtic operator, various control
+ * structures), while trying to combine code from other parts of the
+ * parser as well.
+ */
+?>
+
+*** Testing assignments and variable aliasing: ***<br>
+<?php
+ /* This test tests assignments to variables using other variables as variable-names */
+ $a = "b";
+ $$a = "test";
+ $$$a = "blah";
+ ${$$$a}["associative arrays work too"] = "this is nifty";
+?>
+This should read "blah": <?php echo "$test<br>\n"; ?>
+This should read "this is nifty": <?php echo $blah[$test="associative arrays work too"]."<br>\n"; ?>
+*************************************************<br>
+
+*** Testing integer operators ***<br>
+<?php
+ /* test just about any operator possible on $i and $j (ints) */
+ $i = 5;
+ $j = 3;
+?>
+Correct result - 8: <?php echo $i+$j; ?><br>
+Correct result - 8: <?php echo $i+$j; ?><br>
+Correct result - 2: <?php echo $i-$j; ?><br>
+Correct result - -2: <?php echo $j-$i; ?><br>
+Correct result - 15: <?php echo $i*$j; ?><br>
+Correct result - 15: <?php echo $j*$i; ?><br>
+Correct result - 2: <?php echo $i%$j; ?><br>
+Correct result - 3: <?php echo $j%$i; ?><br>
+*********************************<br>
+
+*** Testing real operators ***<br>
+<?php
+ /* test just about any operator possible on $i and $j (floats) */
+ $i = 5.0;
+ $j = 3.0;
+?>
+Correct result - 8: <?php echo $i+$j; ?><br>
+Correct result - 8: <?php echo $i+$j; ?><br>
+Correct result - 2: <?php echo $i-$j; ?><br>
+Correct result - -2: <?php echo $j-$i; ?><br>
+Correct result - 15: <?php echo $i*$j; ?><br>
+Correct result - 15: <?php echo $j*$i; ?><br>
+Correct result - 2: <?php echo $i%$j; ?><br>
+Correct result - 3: <?php echo $j%$i; ?><br>
+*********************************<br>
+
+*** Testing if/elseif/else control ***<br>
+
+<?php
+/* sick if/elseif/else test by Andi :) */
+$a = 5;
+if ($a == "4") {
+ echo "This "." does "." not "." work<br>\n";
+} elseif ($a == "5") {
+ echo "This "." works<br>\n";
+ $a = 6;
+ if ("andi" == ($test = "andi")) {
+ echo "this_still_works<br>\n";
+ } elseif (1) {
+ echo "should_not_print<br>\n";
+ } else {
+ echo "should_not_print<br>\n";
+ }
+ if (44 == 43) {
+ echo "should_not_print<br>\n";
+ } else {
+ echo "should_print<br>\n";
+ }
+} elseif ($a == 6) {
+ echo "this "."broken<br>\n";
+ if (0) {
+ echo "this_should_not_print<br>\n";
+ } else {
+ echo "TestingDanglingElse_This_Should_not_print<br>\n";
+ }
+} else {
+ echo "This "."does "." not"." work<br>\n";
+}
+?>
+
+
+*** Seriously nested if's test ***<br>
+** spelling correction by kluzz **
+<?php
+/* yet another sick if/elseif/else test by Zeev */
+$i=$j=0;
+echo "Only two lines of text should follow:<br>\n";
+if (0) { /* this code is not supposed to be executed */
+ echo "hmm, this shouldn't be displayed #1<br>\n";
+ $j++;
+ if (1) {
+ $i
++=
+ $j;
+ if (0) {
+ $j = ++$i;
+ if (1) {
+ $j *= $i;
+ echo "damn, this shouldn't be displayed<br>\n";
+ } else {
+ $j /= $i;
+ ++$j;
+ echo "this shouldn't be displayed either<br>\n";
+ }
+ } elseif (1) {
+ $i++; $j++;
+ echo "this isn't supposed to be displayed<br>\n";
+ }
+ } elseif (0) {
+ $i++;
+ echo "this definitely shouldn't be displayed<br>\n";
+ } else {
+ --$j;
+ echo "and this too shouldn't be displayed<br>\n";
+ while ($j>0) {
+ $j--;
+ }
+ }
+} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */
+ $i = ++$j;
+ echo "hmm, this shouldn't be displayed #2<br>\n";
+ if (1) {
+ $j = ++$i;
+ if (0) {
+ $j = $i*2+$j*($i++);
+ if (1) {
+ $i++;
+ echo "damn, this shouldn't be displayed<br>\n";
+ } else {
+ $j++;
+ echo "this shouldn't be displayed either<br>\n";
+ }
+ } else if (1) {
+ ++$j;
+ echo "this isn't supposed to be displayed<br>\n";
+ }
+ } elseif (0) {
+ $j++;
+ echo "this definitely shouldn't be displayed<br>\n";
+ } else {
+ $i++;
+ echo "and this too shouldn't be displayed<br>\n";
+ }
+} else {
+ $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */
+ echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j<br>\n";
+ if (1) {
+ $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */
+ if (0) {
+ $j += 40;
+ if (1) {
+ $i += 50;
+ echo "damn, this shouldn't be displayed<br>\n";
+ } else {
+ $j += 20;
+ echo "this shouldn't be displayed either<br>\n";
+ }
+ } else if (1) {
+ $j *= $i; /* $j *= 2 --> $j == 4 */
+ echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j<br>\n";
+ echo "3 loop iterations should follow:<br>\n";
+ while ($i<=$j) {
+ echo $i++." $j<br>\n";
+ }
+ }
+ } elseif (0) {
+ echo "this definitely shouldn't be displayed<br>\n";
+ } else {
+ echo "and this too shouldn't be displayed<br>\n";
+ }
+ echo "**********************************<br>\n";
+}
+?>
+
+*** C-style else-if's ***<br>
+<?php
+ /* looks like without we even tried, C-style else-if structure works fine! */
+ if ($a=0) {
+ echo "This shouldn't be displayed<br>\n";
+ } else if ($a++) {
+ echo "This shouldn't be displayed either<br>\n";
+ } else if (--$a) {
+ echo "No, this neither<br>\n";
+ } else if (++$a) {
+ echo "This should be displayed<br>\n";
+ } else {
+ echo "This shouldn't be displayed at all<br>\n";
+ }
+?>
+*************************<br>
+
+*** WHILE tests ***<br>
+<?php
+$i=0;
+$j=20;
+while ($i<(2*$j)) {
+ if ($i>$j) {
+ echo "$i is greater than $j<br>\n";
+ } else if ($i==$j) {
+ echo "$i equals $j<br>\n";
+ } else {
+ echo "$i is smaller than $j<br>\n";
+ }
+ $i++;
+}
+?>
+*******************<br>
+
+
+*** Nested WHILEs ***<br>
+<?php
+$arr_len=3;
+
+$i=0;
+while ($i<$arr_len) {
+ $j=0;
+ while ($j<$arr_len) {
+ $k=0;
+ while ($k<$arr_len) {
+ ${"test$i$j"}[$k] = $i+$j+$k;
+ $k++;
+ }
+ $j++;
+ }
+ $i++;
+}
+
+echo "Each array variable should be equal to the sum of its indices:<br>\n";
+
+$i=0;
+while ($i<$arr_len) {
+ $j=0;
+ while ($j<$arr_len) {
+ $k=0;
+ while ($k<$arr_len) {
+ echo "\${test$i$j}[$k] = ".${"test$i$j"}[$k]."<br>\n";
+ $k++;
+ }
+ $j++;
+ }
+ $i++;
+}
+?>
+*********************<br>
+
+*** hash test... ***<br>
+<?php
+/*
+$i=0;
+
+while ($i<10000) {
+ $arr[$i]=$i;
+ $i++;
+}
+
+$i=0;
+while ($i<10000) {
+ echo $arr[$i++]."<br>\n";
+}
+*/
+echo "commented out...";
+?>
+
+**************************<br>
+
+*** Hash resizing test ***<br>
+<?php
+$i = 10;
+$a = 'b';
+while ($i > 0) {
+ $a = $a . 'a';
+ echo "$a<br>\n";
+ $resize[$a] = $i;
+ $i--;
+}
+$i = 10;
+$a = 'b';
+while ($i > 0) {
+ $a = $a . 'a';
+ echo "$a<br>\n";
+ echo $resize[$a]."<br>\n";
+ $i--;
+}
+?>
+**************************<br>
+
+
+*** break/continue test ***<br>
+<?php
+$i=0;
+
+echo "\$i should go from 0 to 2<br>\n";
+while ($i<5) {
+ if ($i>2) {
+ break;
+ }
+ $j=0;
+ echo "\$j should go from 3 to 4, and \$q should go from 3 to 4<br>\n";
+ while ($j<5) {
+ if ($j<=2) {
+ $j++;
+ continue;
+ }
+ echo " \$j=$j<br>\n";
+ for ($q=0; $q<=10; $q++) {
+ if ($q<3) {
+ continue;
+ }
+ if ($q>4) {
+ break;
+ }
+ echo " \$q=$q<br>\n";
+ }
+ $j++;
+ }
+ $j=0;
+ echo "\$j should go from 0 to 2<br>\n";
+ while ($j<5) {
+ if ($j>2) {
+ $k=0;
+ echo "\$k should go from 0 to 2<br>\n";
+ while ($k<5) {
+ if ($k>2) {
+ break 2;
+ }
+ echo " \$k=$k<br>\n";
+ $k++;
+ }
+ }
+ echo " \$j=$j<br>\n";
+ $j++;
+ }
+ echo "\$i=$i<br>\n";
+ $i++;
+}
+?>
+***********************<br>
+
+*** Nested file include test ***<br>
+<?php include("023-2.inc"); ?>
+********************************<br>
+
+<?php
+{
+ echo "Tests completed.<br>\n"; # testing some PHP style comment...
+}
+?>
diff --git a/tests/lang/023-2.inc b/tests/lang/023-2.inc
new file mode 100644
index 0000000..6dd1e73
--- /dev/null
+++ b/tests/lang/023-2.inc
@@ -0,0 +1,6 @@
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+<?php echo "and this is PHP code, 2+2=".(2+2).""; ?>
+
+</html>
diff --git a/tests/lang/023.phpt b/tests/lang/023.phpt
new file mode 100644
index 0000000..331308d
--- /dev/null
+++ b/tests/lang/023.phpt
@@ -0,0 +1,256 @@
+--TEST--
+Regression test
+--INI--
+date.timezone=UTC
+--FILE--
+PHP Regression Test
+
+<?php
+
+include("023-1.inc");
+
+$wedding_timestamp = mktime(20,0,0,8,31,1997);
+$time_left=$wedding_timestamp-time();
+
+if ($time_left>0) {
+ $days = $time_left/(24*3600);
+ $time_left -= $days*24*3600;
+ $hours = $time_left/3600;
+ $time_left -= $hours*3600;
+ $minutes = $time_left/60;
+ echo "Limor Ullmann is getting married on ".($wedding_date=date("l, F dS, Y",$wedding_timestamp)).",\nwhich is $days days, $hours hours and $minutes minutes from now.\n";
+ echo "Her hashed wedding date is $wedding_date.\n";
+} else {
+ echo "Limor Ullmann is now Limor Baruch :I\n";
+}
+?>
+--EXPECT--
+PHP Regression Test
+
+<html>
+<head>
+
+*** Testing assignments and variable aliasing: ***<br>
+This should read "blah": blah<br>
+This should read "this is nifty": this is nifty<br>
+*************************************************<br>
+
+*** Testing integer operators ***<br>
+Correct result - 8: 8<br>
+Correct result - 8: 8<br>
+Correct result - 2: 2<br>
+Correct result - -2: -2<br>
+Correct result - 15: 15<br>
+Correct result - 15: 15<br>
+Correct result - 2: 2<br>
+Correct result - 3: 3<br>
+*********************************<br>
+
+*** Testing real operators ***<br>
+Correct result - 8: 8<br>
+Correct result - 8: 8<br>
+Correct result - 2: 2<br>
+Correct result - -2: -2<br>
+Correct result - 15: 15<br>
+Correct result - 15: 15<br>
+Correct result - 2: 2<br>
+Correct result - 3: 3<br>
+*********************************<br>
+
+*** Testing if/elseif/else control ***<br>
+
+This works<br>
+this_still_works<br>
+should_print<br>
+
+
+*** Seriously nested if's test ***<br>
+** spelling correction by kluzz **
+Only two lines of text should follow:<br>
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0<br>
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4<br>
+3 loop iterations should follow:<br>
+2 4<br>
+3 4<br>
+4 4<br>
+**********************************<br>
+
+*** C-style else-if's ***<br>
+This should be displayed<br>
+*************************<br>
+
+*** WHILE tests ***<br>
+0 is smaller than 20<br>
+1 is smaller than 20<br>
+2 is smaller than 20<br>
+3 is smaller than 20<br>
+4 is smaller than 20<br>
+5 is smaller than 20<br>
+6 is smaller than 20<br>
+7 is smaller than 20<br>
+8 is smaller than 20<br>
+9 is smaller than 20<br>
+10 is smaller than 20<br>
+11 is smaller than 20<br>
+12 is smaller than 20<br>
+13 is smaller than 20<br>
+14 is smaller than 20<br>
+15 is smaller than 20<br>
+16 is smaller than 20<br>
+17 is smaller than 20<br>
+18 is smaller than 20<br>
+19 is smaller than 20<br>
+20 equals 20<br>
+21 is greater than 20<br>
+22 is greater than 20<br>
+23 is greater than 20<br>
+24 is greater than 20<br>
+25 is greater than 20<br>
+26 is greater than 20<br>
+27 is greater than 20<br>
+28 is greater than 20<br>
+29 is greater than 20<br>
+30 is greater than 20<br>
+31 is greater than 20<br>
+32 is greater than 20<br>
+33 is greater than 20<br>
+34 is greater than 20<br>
+35 is greater than 20<br>
+36 is greater than 20<br>
+37 is greater than 20<br>
+38 is greater than 20<br>
+39 is greater than 20<br>
+*******************<br>
+
+
+*** Nested WHILEs ***<br>
+Each array variable should be equal to the sum of its indices:<br>
+${test00}[0] = 0<br>
+${test00}[1] = 1<br>
+${test00}[2] = 2<br>
+${test01}[0] = 1<br>
+${test01}[1] = 2<br>
+${test01}[2] = 3<br>
+${test02}[0] = 2<br>
+${test02}[1] = 3<br>
+${test02}[2] = 4<br>
+${test10}[0] = 1<br>
+${test10}[1] = 2<br>
+${test10}[2] = 3<br>
+${test11}[0] = 2<br>
+${test11}[1] = 3<br>
+${test11}[2] = 4<br>
+${test12}[0] = 3<br>
+${test12}[1] = 4<br>
+${test12}[2] = 5<br>
+${test20}[0] = 2<br>
+${test20}[1] = 3<br>
+${test20}[2] = 4<br>
+${test21}[0] = 3<br>
+${test21}[1] = 4<br>
+${test21}[2] = 5<br>
+${test22}[0] = 4<br>
+${test22}[1] = 5<br>
+${test22}[2] = 6<br>
+*********************<br>
+
+*** hash test... ***<br>
+commented out...
+**************************<br>
+
+*** Hash resizing test ***<br>
+ba<br>
+baa<br>
+baaa<br>
+baaaa<br>
+baaaaa<br>
+baaaaaa<br>
+baaaaaaa<br>
+baaaaaaaa<br>
+baaaaaaaaa<br>
+baaaaaaaaaa<br>
+ba<br>
+10<br>
+baa<br>
+9<br>
+baaa<br>
+8<br>
+baaaa<br>
+7<br>
+baaaaa<br>
+6<br>
+baaaaaa<br>
+5<br>
+baaaaaaa<br>
+4<br>
+baaaaaaaa<br>
+3<br>
+baaaaaaaaa<br>
+2<br>
+baaaaaaaaaa<br>
+1<br>
+**************************<br>
+
+
+*** break/continue test ***<br>
+$i should go from 0 to 2<br>
+$j should go from 3 to 4, and $q should go from 3 to 4<br>
+ $j=3<br>
+ $q=3<br>
+ $q=4<br>
+ $j=4<br>
+ $q=3<br>
+ $q=4<br>
+$j should go from 0 to 2<br>
+ $j=0<br>
+ $j=1<br>
+ $j=2<br>
+$k should go from 0 to 2<br>
+ $k=0<br>
+ $k=1<br>
+ $k=2<br>
+$i=0<br>
+$j should go from 3 to 4, and $q should go from 3 to 4<br>
+ $j=3<br>
+ $q=3<br>
+ $q=4<br>
+ $j=4<br>
+ $q=3<br>
+ $q=4<br>
+$j should go from 0 to 2<br>
+ $j=0<br>
+ $j=1<br>
+ $j=2<br>
+$k should go from 0 to 2<br>
+ $k=0<br>
+ $k=1<br>
+ $k=2<br>
+$i=1<br>
+$j should go from 3 to 4, and $q should go from 3 to 4<br>
+ $j=3<br>
+ $q=3<br>
+ $q=4<br>
+ $j=4<br>
+ $q=3<br>
+ $q=4<br>
+$j should go from 0 to 2<br>
+ $j=0<br>
+ $j=1<br>
+ $j=2<br>
+$k should go from 0 to 2<br>
+ $k=0<br>
+ $k=1<br>
+ $k=2<br>
+$i=2<br>
+***********************<br>
+
+*** Nested file include test ***<br>
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************<br>
+
+Tests completed.<br>
+Limor Ullmann is now Limor Baruch :I
diff --git a/tests/lang/024.phpt b/tests/lang/024.phpt
new file mode 100644
index 0000000..954b58f
--- /dev/null
+++ b/tests/lang/024.phpt
@@ -0,0 +1,11623 @@
+--TEST--
+Looped regression test (may take a while)
+--FILE--
+<?php
+for ($jdk=0; $jdk<50; $jdk++) {
+?><html>
+<head>
+<?php /* the point of this file is to intensively test various aspects of the parser.
+ * right now, each test focuses in one aspect only (e.g. variable aliasing, arithemtic operator,
+ * various control structures), while trying to combine code from other parts of the parser as well.
+ */
+?>
+*** Testing assignments and variable aliasing: ***
+<?php
+ /* This test tests assignments to variables using other variables as variable-names */
+ $a = "b";
+ $$a = "test";
+ $$$a = "blah";
+ ${$$$a}["associative arrays work too"] = "this is nifty";
+?>
+This should read "blah": <?php echo "$test\n"; ?>
+This should read "this is nifty": <?php echo $blah[$test="associative arrays work too"]."\n"; ?>
+*************************************************
+
+*** Testing integer operators ***
+<?php
+ /* test just about any operator possible on $i and $j (ints) */
+ $i = 5;
+ $j = 3;
+?>
+Correct result - 8: <?php echo $i+$j; ?>
+
+Correct result - 8: <?php echo $i+$j; ?>
+
+Correct result - 2: <?php echo $i-$j; ?>
+
+Correct result - -2: <?php echo $j-$i; ?>
+
+Correct result - 15: <?php echo $i*$j; ?>
+
+Correct result - 15: <?php echo $j*$i; ?>
+
+Correct result - 2: <?php echo $i%$j; ?>
+
+Correct result - 3: <?php echo $j%$i; ?>
+
+*********************************
+
+*** Testing real operators ***
+<?php
+ /* test just about any operator possible on $i and $j (floats) */
+ $i = 5.0;
+ $j = 3.0;
+?>
+Correct result - 8: <?php echo $i+$j; ?>
+
+Correct result - 8: <?php echo $i+$j; ?>
+
+Correct result - 2: <?php echo $i-$j; ?>
+
+Correct result - -2: <?php echo $j-$i; ?>
+
+Correct result - 15: <?php echo $i*$j; ?>
+
+Correct result - 15: <?php echo $j*$i; ?>
+
+Correct result - 2: <?php echo $i%$j; ?>
+
+Correct result - 3: <?php echo $j%$i; ?>
+
+*********************************
+
+*** Testing if/elseif/else control ***
+
+<?php
+/* sick if/elseif/else test by Andi :) */
+$a = 5;
+if ($a == "4") {
+ echo "This "." does "." not "." work\n";
+} elseif ($a == "5") {
+ echo "This "." works\n";
+ $a = 6;
+ if ("andi" == ($test = "andi")) {
+ echo "this_still_works\n";
+ } elseif (1) {
+ echo "should_not_print\n";
+ } else {
+ echo "should_not_print\n";
+ }
+ if (44 == 43) {
+ echo "should_not_print\n";
+ } else {
+ echo "should_print\n";
+ }
+} elseif ($a == 6) {
+ echo "this "."broken\n";
+ if (0) {
+ echo "this_should_not_print\n";
+ } else {
+ echo "TestingDanglingElse_This_Should_not_print\n";
+ }
+} else {
+ echo "This "."does "." not"." work\n";
+}
+?>
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+<?php
+/* yet another sick if/elseif/else test by Zeev */
+$i=$j=0;
+echo "Only two lines of text should follow:\n";
+if (0) { /* this code is not supposed to be executed */
+ echo "hmm, this shouldn't be displayed #1\n";
+ $j++;
+ if (1) {
+ $i += $j;
+ if (0) {
+ $j = ++$i;
+ if (1) {
+ $j *= $i;
+ echo "damn, this shouldn't be displayed\n";
+ } else {
+ $j /= $i;
+ ++$j;
+ echo "this shouldn't be displayed either\n";
+ }
+ } elseif (1) {
+ $i++; $j++;
+ echo "this isn't supposed to be displayed\n";
+ }
+ } elseif (0) {
+ $i++;
+ echo "this definitely shouldn't be displayed\n";
+ } else {
+ --$j;
+ echo "and this too shouldn't be displayed\n";
+ while ($j>0) {
+ $j--;
+ }
+ }
+} elseif (2-2) { /* as long as 2-2==0, this isn't supposed to be executed either */
+ $i = ++$j;
+ echo "hmm, this shouldn't be displayed #2\n";
+ if (1) {
+ $j = ++$i;
+ if (0) {
+ $j = $i*2+$j*($i++);
+ if (1) {
+ $i++;
+ echo "damn, this shouldn't be displayed\n";
+ } else {
+ $j++;
+ echo "this shouldn't be displayed either\n";
+ }
+ } else if (1) {
+ ++$j;
+ echo "this isn't supposed to be displayed\n";
+ }
+ } elseif (0) {
+ $j++;
+ echo "this definitely shouldn't be displayed\n";
+ } else {
+ $i++;
+ echo "and this too shouldn't be displayed\n";
+ }
+} else {
+ $j=$i++; /* this should set $i to 1, but shouldn't change $j (it's assigned $i's previous values, zero) */
+ echo "this should be displayed. should be: \$i=1, \$j=0. is: \$i=$i, \$j=$j\n";
+ if (1) {
+ $j += ++$i; /* ++$i --> $i==2, $j += 2 --> $j==2 */
+ if (0) {
+ $j += 40;
+ if (1) {
+ $i += 50;
+ echo "damn, this shouldn't be displayed\n";
+ } else {
+ $j += 20;
+ echo "this shouldn't be displayed either\n";
+ }
+ } else if (1) {
+ $j *= $i; /* $j *= 2 --> $j == 4 */
+ echo "this is supposed to be displayed. should be: \$i=2, \$j=4. is: \$i=$i, \$j=$j\n";
+ echo "3 loop iterations should follow:\n";
+ while ($i<=$j) {
+ echo $i++." $j\n";
+ }
+ }
+ } elseif (0) {
+ echo "this definitely shouldn't be displayed\n";
+ } else {
+ echo "and this too shouldn't be displayed\n";
+ }
+ echo "**********************************\n";
+}
+?>
+
+*** C-style else-if's ***
+<?php
+ /* looks like without we even tried, C-style else-if structure works fine! */
+ if ($a=0) {
+ echo "This shouldn't be displayed\n";
+ } else if ($a++) {
+ echo "This shouldn't be displayed either\n";
+ } else if (--$a) {
+ echo "No, this neither\n";
+ } else if (++$a) {
+ echo "This should be displayed\n";
+ } else {
+ echo "This shouldn't be displayed at all\n";
+ }
+?>
+*************************
+
+*** WHILE tests ***
+<?php
+$i=0;
+$j=20;
+while ($i<(2*$j)) {
+ if ($i>$j) {
+ echo "$i is greater than $j\n";
+ } else if ($i==$j) {
+ echo "$i equals $j\n";
+ } else {
+ echo "$i is smaller than $j\n";
+ }
+ $i++;
+}
+?>
+*******************
+
+
+*** Nested WHILEs ***
+<?php
+$arr_len=3;
+
+$i=0;
+while ($i<$arr_len) {
+ $j=0;
+ while ($j<$arr_len) {
+ $k=0;
+ while ($k<$arr_len) {
+ ${"test$i$j"}[$k] = $i+$j+$k;
+ $k++;
+ }
+ $j++;
+ }
+ $i++;
+}
+
+echo "Each array variable should be equal to the sum of its indices:\n";
+
+$i=0;
+while ($i<$arr_len) {
+ $j=0;
+ while ($j<$arr_len) {
+ $k=0;
+ while ($k<$arr_len) {
+ echo "\${test$i$j}[$k] = ".${"test$i$j"}[$k]."\n";
+ $k++;
+ }
+ $j++;
+ }
+ $i++;
+}
+?>
+*********************
+
+*** hash test... ***
+<?php
+/*
+$i=0;
+
+while ($i<10000) {
+ $arr[$i]=$i;
+ $i++;
+}
+
+$i=0;
+while ($i<10000) {
+ echo $arr[$i++]."\n";
+}
+*/
+echo "commented out...";
+?>
+
+**************************
+
+*** Hash resizing test ***
+<?php
+$i = 10;
+$a = "b";
+while ($i > 0) {
+ $a = $a . "a";
+ echo "$a\n";
+ $resize[$a] = $i;
+ $i--;
+}
+$i = 10;
+$a = "b";
+while ($i > 0) {
+ $a = $a . "a";
+ echo "$a\n";
+ echo $resize[$a]."\n";
+ $i--;
+}
+?>
+**************************
+
+
+*** break/continue test ***
+<?php
+$i=0;
+
+echo "\$i should go from 0 to 2\n";
+while ($i<5) {
+ if ($i>2) {
+ break;
+ }
+ $j=0;
+ echo "\$j should go from 3 to 4, and \$q should go from 3 to 4\n";
+ while ($j<5) {
+ if ($j<=2) {
+ $j++;
+ continue;
+ }
+ echo " \$j=$j\n";
+ for ($q=0; $q<=10; $q++) {
+ if ($q<3) {
+ continue;
+ }
+ if ($q>4) {
+ break;
+ }
+ echo " \$q=$q\n";
+ }
+ $j++;
+ }
+ $j=0;
+ echo "\$j should go from 0 to 2\n";
+ while ($j<5) {
+ if ($j>2) {
+ $k=0;
+ echo "\$k should go from 0 to 2\n";
+ while ($k<5) {
+ if ($k>2) {
+ break 2;
+ }
+ echo " \$k=$k\n";
+ $k++;
+ }
+ }
+ echo " \$j=$j\n";
+ $j++;
+ }
+ echo "\$i=$i\n";
+ $i++;
+}
+?>
+***********************
+
+*** Nested file include test ***
+<?php include("023-2.inc"); ?>
+********************************
+
+<?php
+{
+ echo "Tests completed.\n"; # testing some PHP style comment...
+}
+
+} ?>
+--EXPECT--
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
+<html>
+<head>
+*** Testing assignments and variable aliasing: ***
+This should read "blah": blah
+This should read "this is nifty": this is nifty
+*************************************************
+
+*** Testing integer operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing real operators ***
+Correct result - 8: 8
+Correct result - 8: 8
+Correct result - 2: 2
+Correct result - -2: -2
+Correct result - 15: 15
+Correct result - 15: 15
+Correct result - 2: 2
+Correct result - 3: 3
+*********************************
+
+*** Testing if/elseif/else control ***
+
+This works
+this_still_works
+should_print
+
+
+*** Seriously nested if's test ***
+** spelling correction by kluzz **
+Only two lines of text should follow:
+this should be displayed. should be: $i=1, $j=0. is: $i=1, $j=0
+this is supposed to be displayed. should be: $i=2, $j=4. is: $i=2, $j=4
+3 loop iterations should follow:
+2 4
+3 4
+4 4
+**********************************
+
+*** C-style else-if's ***
+This should be displayed
+*************************
+
+*** WHILE tests ***
+0 is smaller than 20
+1 is smaller than 20
+2 is smaller than 20
+3 is smaller than 20
+4 is smaller than 20
+5 is smaller than 20
+6 is smaller than 20
+7 is smaller than 20
+8 is smaller than 20
+9 is smaller than 20
+10 is smaller than 20
+11 is smaller than 20
+12 is smaller than 20
+13 is smaller than 20
+14 is smaller than 20
+15 is smaller than 20
+16 is smaller than 20
+17 is smaller than 20
+18 is smaller than 20
+19 is smaller than 20
+20 equals 20
+21 is greater than 20
+22 is greater than 20
+23 is greater than 20
+24 is greater than 20
+25 is greater than 20
+26 is greater than 20
+27 is greater than 20
+28 is greater than 20
+29 is greater than 20
+30 is greater than 20
+31 is greater than 20
+32 is greater than 20
+33 is greater than 20
+34 is greater than 20
+35 is greater than 20
+36 is greater than 20
+37 is greater than 20
+38 is greater than 20
+39 is greater than 20
+*******************
+
+
+*** Nested WHILEs ***
+Each array variable should be equal to the sum of its indices:
+${test00}[0] = 0
+${test00}[1] = 1
+${test00}[2] = 2
+${test01}[0] = 1
+${test01}[1] = 2
+${test01}[2] = 3
+${test02}[0] = 2
+${test02}[1] = 3
+${test02}[2] = 4
+${test10}[0] = 1
+${test10}[1] = 2
+${test10}[2] = 3
+${test11}[0] = 2
+${test11}[1] = 3
+${test11}[2] = 4
+${test12}[0] = 3
+${test12}[1] = 4
+${test12}[2] = 5
+${test20}[0] = 2
+${test20}[1] = 3
+${test20}[2] = 4
+${test21}[0] = 3
+${test21}[1] = 4
+${test21}[2] = 5
+${test22}[0] = 4
+${test22}[1] = 5
+${test22}[2] = 6
+*********************
+
+*** hash test... ***
+commented out...
+**************************
+
+*** Hash resizing test ***
+ba
+baa
+baaa
+baaaa
+baaaaa
+baaaaaa
+baaaaaaa
+baaaaaaaa
+baaaaaaaaa
+baaaaaaaaaa
+ba
+10
+baa
+9
+baaa
+8
+baaaa
+7
+baaaaa
+6
+baaaaaa
+5
+baaaaaaa
+4
+baaaaaaaa
+3
+baaaaaaaaa
+2
+baaaaaaaaaa
+1
+**************************
+
+
+*** break/continue test ***
+$i should go from 0 to 2
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=0
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=1
+$j should go from 3 to 4, and $q should go from 3 to 4
+ $j=3
+ $q=3
+ $q=4
+ $j=4
+ $q=3
+ $q=4
+$j should go from 0 to 2
+ $j=0
+ $j=1
+ $j=2
+$k should go from 0 to 2
+ $k=0
+ $k=1
+ $k=2
+$i=2
+***********************
+
+*** Nested file include test ***
+<html>
+This is Finish.phtml. This file is supposed to be included
+from regression_test.phtml. This is normal HTML.
+and this is PHP code, 2+2=4
+</html>
+********************************
+
+Tests completed.
diff --git a/tests/lang/025.phpt b/tests/lang/025.phpt
new file mode 100644
index 0000000..382960f
--- /dev/null
+++ b/tests/lang/025.phpt
@@ -0,0 +1,531 @@
+--TEST--
+Mean recursion test
+--FILE--
+<?php
+function RekTest ($nr) {
+ echo " $nr ";
+ $j=$nr+1;
+ while ($j < 10) {
+ echo " a ";
+ RekTest($j);
+ $j++;
+ echo " b $j ";
+ }
+ echo "\n";
+}
+
+RekTest(0);
+?>
+--EXPECT--
+ 0 a 1 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 4 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 4 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 2 a 2 a 3 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 4 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 3 a 3 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 4 a 4 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 5 a 5 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 6 a 6 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 7 a 7 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
+ b 8 a 8 a 9
+ b 10
+ b 9 a 9
+ b 10
diff --git a/tests/lang/026.phpt b/tests/lang/026.phpt
new file mode 100644
index 0000000..eb2d621
--- /dev/null
+++ b/tests/lang/026.phpt
@@ -0,0 +1,6 @@
+--TEST--
+Testing string scanner confirmance
+--FILE--
+<?php echo "\"\t\\'" . '\n\\\'a\\\b\\' ?>
+--EXPECT--
+" \'\n\'a\\b\
diff --git a/tests/lang/027.phpt b/tests/lang/027.phpt
new file mode 100644
index 0000000..d3eb74b
--- /dev/null
+++ b/tests/lang/027.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Testing do-while loop
+--FILE--
+<?php
+$i=3;
+do {
+ echo $i;
+ $i--;
+} while($i>0);
+?>
+--EXPECT--
+321
diff --git a/tests/lang/028.phpt b/tests/lang/028.phpt
new file mode 100644
index 0000000..bd4525e
--- /dev/null
+++ b/tests/lang/028.phpt
@@ -0,0 +1,1058 @@
+--TEST--
+Testing calling user-level functions from C
+--FILE--
+<?php
+
+error_reporting(1023);
+
+function print_stuff($stuff)
+{
+ print $stuff;
+}
+
+
+function still_working()
+{
+ return "I'm still alive";
+}
+
+function dafna()
+{
+ static $foo = 0;
+
+ print "Dafna!\n";
+ print call_user_func("still_working")."\n";
+ $foo++;
+ return (string) $foo;
+}
+
+
+class dafna_class {
+ function dafna_class() {
+ $this->myname = "Dafna";
+ }
+ function GetMyName() {
+ return $this->myname;
+ }
+ function SetMyName($name) {
+ $this->myname = $name;
+ }
+};
+
+for ($i=0; $i<200; $i++):
+ print "$i\n";
+ call_user_func("dafna");
+ call_user_func("print_stuff","Hey there!!\n");
+ print "$i\n";
+endfor;
+
+
+$dafna = new dafna_class();
+
+print $name=call_user_func(array(&$dafna,"GetMyName"));
+print "\n";
+
+?>
+--EXPECT--
+0
+Dafna!
+I'm still alive
+Hey there!!
+0
+1
+Dafna!
+I'm still alive
+Hey there!!
+1
+2
+Dafna!
+I'm still alive
+Hey there!!
+2
+3
+Dafna!
+I'm still alive
+Hey there!!
+3
+4
+Dafna!
+I'm still alive
+Hey there!!
+4
+5
+Dafna!
+I'm still alive
+Hey there!!
+5
+6
+Dafna!
+I'm still alive
+Hey there!!
+6
+7
+Dafna!
+I'm still alive
+Hey there!!
+7
+8
+Dafna!
+I'm still alive
+Hey there!!
+8
+9
+Dafna!
+I'm still alive
+Hey there!!
+9
+10
+Dafna!
+I'm still alive
+Hey there!!
+10
+11
+Dafna!
+I'm still alive
+Hey there!!
+11
+12
+Dafna!
+I'm still alive
+Hey there!!
+12
+13
+Dafna!
+I'm still alive
+Hey there!!
+13
+14
+Dafna!
+I'm still alive
+Hey there!!
+14
+15
+Dafna!
+I'm still alive
+Hey there!!
+15
+16
+Dafna!
+I'm still alive
+Hey there!!
+16
+17
+Dafna!
+I'm still alive
+Hey there!!
+17
+18
+Dafna!
+I'm still alive
+Hey there!!
+18
+19
+Dafna!
+I'm still alive
+Hey there!!
+19
+20
+Dafna!
+I'm still alive
+Hey there!!
+20
+21
+Dafna!
+I'm still alive
+Hey there!!
+21
+22
+Dafna!
+I'm still alive
+Hey there!!
+22
+23
+Dafna!
+I'm still alive
+Hey there!!
+23
+24
+Dafna!
+I'm still alive
+Hey there!!
+24
+25
+Dafna!
+I'm still alive
+Hey there!!
+25
+26
+Dafna!
+I'm still alive
+Hey there!!
+26
+27
+Dafna!
+I'm still alive
+Hey there!!
+27
+28
+Dafna!
+I'm still alive
+Hey there!!
+28
+29
+Dafna!
+I'm still alive
+Hey there!!
+29
+30
+Dafna!
+I'm still alive
+Hey there!!
+30
+31
+Dafna!
+I'm still alive
+Hey there!!
+31
+32
+Dafna!
+I'm still alive
+Hey there!!
+32
+33
+Dafna!
+I'm still alive
+Hey there!!
+33
+34
+Dafna!
+I'm still alive
+Hey there!!
+34
+35
+Dafna!
+I'm still alive
+Hey there!!
+35
+36
+Dafna!
+I'm still alive
+Hey there!!
+36
+37
+Dafna!
+I'm still alive
+Hey there!!
+37
+38
+Dafna!
+I'm still alive
+Hey there!!
+38
+39
+Dafna!
+I'm still alive
+Hey there!!
+39
+40
+Dafna!
+I'm still alive
+Hey there!!
+40
+41
+Dafna!
+I'm still alive
+Hey there!!
+41
+42
+Dafna!
+I'm still alive
+Hey there!!
+42
+43
+Dafna!
+I'm still alive
+Hey there!!
+43
+44
+Dafna!
+I'm still alive
+Hey there!!
+44
+45
+Dafna!
+I'm still alive
+Hey there!!
+45
+46
+Dafna!
+I'm still alive
+Hey there!!
+46
+47
+Dafna!
+I'm still alive
+Hey there!!
+47
+48
+Dafna!
+I'm still alive
+Hey there!!
+48
+49
+Dafna!
+I'm still alive
+Hey there!!
+49
+50
+Dafna!
+I'm still alive
+Hey there!!
+50
+51
+Dafna!
+I'm still alive
+Hey there!!
+51
+52
+Dafna!
+I'm still alive
+Hey there!!
+52
+53
+Dafna!
+I'm still alive
+Hey there!!
+53
+54
+Dafna!
+I'm still alive
+Hey there!!
+54
+55
+Dafna!
+I'm still alive
+Hey there!!
+55
+56
+Dafna!
+I'm still alive
+Hey there!!
+56
+57
+Dafna!
+I'm still alive
+Hey there!!
+57
+58
+Dafna!
+I'm still alive
+Hey there!!
+58
+59
+Dafna!
+I'm still alive
+Hey there!!
+59
+60
+Dafna!
+I'm still alive
+Hey there!!
+60
+61
+Dafna!
+I'm still alive
+Hey there!!
+61
+62
+Dafna!
+I'm still alive
+Hey there!!
+62
+63
+Dafna!
+I'm still alive
+Hey there!!
+63
+64
+Dafna!
+I'm still alive
+Hey there!!
+64
+65
+Dafna!
+I'm still alive
+Hey there!!
+65
+66
+Dafna!
+I'm still alive
+Hey there!!
+66
+67
+Dafna!
+I'm still alive
+Hey there!!
+67
+68
+Dafna!
+I'm still alive
+Hey there!!
+68
+69
+Dafna!
+I'm still alive
+Hey there!!
+69
+70
+Dafna!
+I'm still alive
+Hey there!!
+70
+71
+Dafna!
+I'm still alive
+Hey there!!
+71
+72
+Dafna!
+I'm still alive
+Hey there!!
+72
+73
+Dafna!
+I'm still alive
+Hey there!!
+73
+74
+Dafna!
+I'm still alive
+Hey there!!
+74
+75
+Dafna!
+I'm still alive
+Hey there!!
+75
+76
+Dafna!
+I'm still alive
+Hey there!!
+76
+77
+Dafna!
+I'm still alive
+Hey there!!
+77
+78
+Dafna!
+I'm still alive
+Hey there!!
+78
+79
+Dafna!
+I'm still alive
+Hey there!!
+79
+80
+Dafna!
+I'm still alive
+Hey there!!
+80
+81
+Dafna!
+I'm still alive
+Hey there!!
+81
+82
+Dafna!
+I'm still alive
+Hey there!!
+82
+83
+Dafna!
+I'm still alive
+Hey there!!
+83
+84
+Dafna!
+I'm still alive
+Hey there!!
+84
+85
+Dafna!
+I'm still alive
+Hey there!!
+85
+86
+Dafna!
+I'm still alive
+Hey there!!
+86
+87
+Dafna!
+I'm still alive
+Hey there!!
+87
+88
+Dafna!
+I'm still alive
+Hey there!!
+88
+89
+Dafna!
+I'm still alive
+Hey there!!
+89
+90
+Dafna!
+I'm still alive
+Hey there!!
+90
+91
+Dafna!
+I'm still alive
+Hey there!!
+91
+92
+Dafna!
+I'm still alive
+Hey there!!
+92
+93
+Dafna!
+I'm still alive
+Hey there!!
+93
+94
+Dafna!
+I'm still alive
+Hey there!!
+94
+95
+Dafna!
+I'm still alive
+Hey there!!
+95
+96
+Dafna!
+I'm still alive
+Hey there!!
+96
+97
+Dafna!
+I'm still alive
+Hey there!!
+97
+98
+Dafna!
+I'm still alive
+Hey there!!
+98
+99
+Dafna!
+I'm still alive
+Hey there!!
+99
+100
+Dafna!
+I'm still alive
+Hey there!!
+100
+101
+Dafna!
+I'm still alive
+Hey there!!
+101
+102
+Dafna!
+I'm still alive
+Hey there!!
+102
+103
+Dafna!
+I'm still alive
+Hey there!!
+103
+104
+Dafna!
+I'm still alive
+Hey there!!
+104
+105
+Dafna!
+I'm still alive
+Hey there!!
+105
+106
+Dafna!
+I'm still alive
+Hey there!!
+106
+107
+Dafna!
+I'm still alive
+Hey there!!
+107
+108
+Dafna!
+I'm still alive
+Hey there!!
+108
+109
+Dafna!
+I'm still alive
+Hey there!!
+109
+110
+Dafna!
+I'm still alive
+Hey there!!
+110
+111
+Dafna!
+I'm still alive
+Hey there!!
+111
+112
+Dafna!
+I'm still alive
+Hey there!!
+112
+113
+Dafna!
+I'm still alive
+Hey there!!
+113
+114
+Dafna!
+I'm still alive
+Hey there!!
+114
+115
+Dafna!
+I'm still alive
+Hey there!!
+115
+116
+Dafna!
+I'm still alive
+Hey there!!
+116
+117
+Dafna!
+I'm still alive
+Hey there!!
+117
+118
+Dafna!
+I'm still alive
+Hey there!!
+118
+119
+Dafna!
+I'm still alive
+Hey there!!
+119
+120
+Dafna!
+I'm still alive
+Hey there!!
+120
+121
+Dafna!
+I'm still alive
+Hey there!!
+121
+122
+Dafna!
+I'm still alive
+Hey there!!
+122
+123
+Dafna!
+I'm still alive
+Hey there!!
+123
+124
+Dafna!
+I'm still alive
+Hey there!!
+124
+125
+Dafna!
+I'm still alive
+Hey there!!
+125
+126
+Dafna!
+I'm still alive
+Hey there!!
+126
+127
+Dafna!
+I'm still alive
+Hey there!!
+127
+128
+Dafna!
+I'm still alive
+Hey there!!
+128
+129
+Dafna!
+I'm still alive
+Hey there!!
+129
+130
+Dafna!
+I'm still alive
+Hey there!!
+130
+131
+Dafna!
+I'm still alive
+Hey there!!
+131
+132
+Dafna!
+I'm still alive
+Hey there!!
+132
+133
+Dafna!
+I'm still alive
+Hey there!!
+133
+134
+Dafna!
+I'm still alive
+Hey there!!
+134
+135
+Dafna!
+I'm still alive
+Hey there!!
+135
+136
+Dafna!
+I'm still alive
+Hey there!!
+136
+137
+Dafna!
+I'm still alive
+Hey there!!
+137
+138
+Dafna!
+I'm still alive
+Hey there!!
+138
+139
+Dafna!
+I'm still alive
+Hey there!!
+139
+140
+Dafna!
+I'm still alive
+Hey there!!
+140
+141
+Dafna!
+I'm still alive
+Hey there!!
+141
+142
+Dafna!
+I'm still alive
+Hey there!!
+142
+143
+Dafna!
+I'm still alive
+Hey there!!
+143
+144
+Dafna!
+I'm still alive
+Hey there!!
+144
+145
+Dafna!
+I'm still alive
+Hey there!!
+145
+146
+Dafna!
+I'm still alive
+Hey there!!
+146
+147
+Dafna!
+I'm still alive
+Hey there!!
+147
+148
+Dafna!
+I'm still alive
+Hey there!!
+148
+149
+Dafna!
+I'm still alive
+Hey there!!
+149
+150
+Dafna!
+I'm still alive
+Hey there!!
+150
+151
+Dafna!
+I'm still alive
+Hey there!!
+151
+152
+Dafna!
+I'm still alive
+Hey there!!
+152
+153
+Dafna!
+I'm still alive
+Hey there!!
+153
+154
+Dafna!
+I'm still alive
+Hey there!!
+154
+155
+Dafna!
+I'm still alive
+Hey there!!
+155
+156
+Dafna!
+I'm still alive
+Hey there!!
+156
+157
+Dafna!
+I'm still alive
+Hey there!!
+157
+158
+Dafna!
+I'm still alive
+Hey there!!
+158
+159
+Dafna!
+I'm still alive
+Hey there!!
+159
+160
+Dafna!
+I'm still alive
+Hey there!!
+160
+161
+Dafna!
+I'm still alive
+Hey there!!
+161
+162
+Dafna!
+I'm still alive
+Hey there!!
+162
+163
+Dafna!
+I'm still alive
+Hey there!!
+163
+164
+Dafna!
+I'm still alive
+Hey there!!
+164
+165
+Dafna!
+I'm still alive
+Hey there!!
+165
+166
+Dafna!
+I'm still alive
+Hey there!!
+166
+167
+Dafna!
+I'm still alive
+Hey there!!
+167
+168
+Dafna!
+I'm still alive
+Hey there!!
+168
+169
+Dafna!
+I'm still alive
+Hey there!!
+169
+170
+Dafna!
+I'm still alive
+Hey there!!
+170
+171
+Dafna!
+I'm still alive
+Hey there!!
+171
+172
+Dafna!
+I'm still alive
+Hey there!!
+172
+173
+Dafna!
+I'm still alive
+Hey there!!
+173
+174
+Dafna!
+I'm still alive
+Hey there!!
+174
+175
+Dafna!
+I'm still alive
+Hey there!!
+175
+176
+Dafna!
+I'm still alive
+Hey there!!
+176
+177
+Dafna!
+I'm still alive
+Hey there!!
+177
+178
+Dafna!
+I'm still alive
+Hey there!!
+178
+179
+Dafna!
+I'm still alive
+Hey there!!
+179
+180
+Dafna!
+I'm still alive
+Hey there!!
+180
+181
+Dafna!
+I'm still alive
+Hey there!!
+181
+182
+Dafna!
+I'm still alive
+Hey there!!
+182
+183
+Dafna!
+I'm still alive
+Hey there!!
+183
+184
+Dafna!
+I'm still alive
+Hey there!!
+184
+185
+Dafna!
+I'm still alive
+Hey there!!
+185
+186
+Dafna!
+I'm still alive
+Hey there!!
+186
+187
+Dafna!
+I'm still alive
+Hey there!!
+187
+188
+Dafna!
+I'm still alive
+Hey there!!
+188
+189
+Dafna!
+I'm still alive
+Hey there!!
+189
+190
+Dafna!
+I'm still alive
+Hey there!!
+190
+191
+Dafna!
+I'm still alive
+Hey there!!
+191
+192
+Dafna!
+I'm still alive
+Hey there!!
+192
+193
+Dafna!
+I'm still alive
+Hey there!!
+193
+194
+Dafna!
+I'm still alive
+Hey there!!
+194
+195
+Dafna!
+I'm still alive
+Hey there!!
+195
+196
+Dafna!
+I'm still alive
+Hey there!!
+196
+197
+Dafna!
+I'm still alive
+Hey there!!
+197
+198
+Dafna!
+I'm still alive
+Hey there!!
+198
+199
+Dafna!
+I'm still alive
+Hey there!!
+199
+Dafna
+
diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt
new file mode 100644
index 0000000..758369b
--- /dev/null
+++ b/tests/lang/030.phpt
@@ -0,0 +1,36 @@
+--TEST--
+$this in constructor test
+--FILE--
+<?php
+class foo {
+ function foo($name) {
+ $GLOBALS['List']= &$this;
+ $this->Name = $name;
+ $GLOBALS['List']->echoName();
+ }
+
+ function echoName() {
+ $GLOBALS['names'][]=$this->Name;
+ }
+}
+
+function &foo2(&$foo) {
+ return $foo;
+}
+
+
+$bar1 =new foo('constructor');
+$bar1->Name = 'outside';
+$bar1->echoName();
+$List->echoName();
+
+$bar1 =& foo2(new foo('constructor'));
+$bar1->Name = 'outside';
+$bar1->echoName();
+
+$List->echoName();
+
+print ($names==array('constructor','outside','outside','constructor','outside','outside')) ? 'success':'failure';
+?>
+--EXPECT--
+success
diff --git a/tests/lang/031.phpt b/tests/lang/031.phpt
new file mode 100644
index 0000000..b2d1e63
--- /dev/null
+++ b/tests/lang/031.phpt
@@ -0,0 +1,70 @@
+--TEST--
+Bug #16227 (Internal hash position bug on assignment)
+--FILE--
+<?php
+// reported by php.net@alienbill.com
+$arrayOuter = array("key1","key2");
+$arrayInner = array("0","1");
+
+print "Correct - with inner loop reset.\n";
+
+while(list(,$o) = each($arrayOuter)){
+ reset($arrayInner);
+ while(list(,$i) = each($arrayInner)){
+ print "inloop $i for $o\n";
+ }
+}
+reset($arrayOuter);
+reset($arrayInner);
+
+print "What happens without inner loop reset.\n";
+
+while(list(,$o) = each($arrayOuter)){
+ while(list(,$i) = each($arrayInner)){
+ print "inloop $i for $o\n";
+ }
+}
+reset($arrayOuter);
+reset($arrayInner);
+
+print "What happens without inner loop reset but copy.\n";
+
+while(list(,$o) = each($arrayOuter)){
+ $placeholder = $arrayInner;
+ while(list(,$i) = each($arrayInner)){
+ print "inloop $i for $o\n";
+ }
+}
+reset($arrayOuter);
+reset($arrayInner);
+
+print "What happens with inner loop reset over copy.\n";
+
+while(list(,$o) = each($arrayOuter)){
+ $placeholder = $arrayInner;
+ while(list(,$i) = each($placeholder)){
+ print "inloop $i for $o\n";
+ }
+}
+reset($arrayOuter);
+reset($arrayInner);
+?>
+--EXPECT--
+Correct - with inner loop reset.
+inloop 0 for key1
+inloop 1 for key1
+inloop 0 for key2
+inloop 1 for key2
+What happens without inner loop reset.
+inloop 0 for key1
+inloop 1 for key1
+What happens without inner loop reset but copy.
+inloop 0 for key1
+inloop 1 for key1
+inloop 0 for key2
+inloop 1 for key2
+What happens with inner loop reset over copy.
+inloop 0 for key1
+inloop 1 for key1
+inloop 0 for key2
+inloop 1 for key2
diff --git a/tests/lang/032.phpt b/tests/lang/032.phpt
new file mode 100644
index 0000000..caa4c7e
--- /dev/null
+++ b/tests/lang/032.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Class method registration
+--FILE--
+<?php
+class A {
+ function foo() {}
+}
+
+class B extends A {
+ function foo() {}
+}
+
+class C extends B {
+ function foo() {}
+}
+
+class D extends A {
+}
+
+class F extends D {
+ function foo() {}
+}
+
+// Following class definition should fail, but cannot test
+/*
+class X {
+ function foo() {}
+ function foo() {}
+}
+*/
+
+echo "OK\n";
+?>
+--EXPECT--
+OK
+
diff --git a/tests/lang/033.phpt b/tests/lang/033.phpt
new file mode 100644
index 0000000..21e3768
--- /dev/null
+++ b/tests/lang/033.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Alternative syntaxes test
+--FILE--
+<?php
+$a = 1;
+
+echo "If: ";
+if ($a) echo 1; else echo 0;
+if ($a):
+ echo 1;
+else:
+ echo 0;
+endif;
+
+echo "\nWhile: ";
+while ($a<5) echo $a++;
+while ($a<9):
+ echo ++$a;
+endwhile;
+
+echo "\nFor: ";
+for($a=0;$a<5;$a++) echo $a;
+for($a=0;$a<5;$a++):
+ echo $a;
+endfor;
+
+echo "\nSwitch: ";
+switch ($a):
+ case 0;
+ echo 0;
+ break;
+ case 5:
+ echo 1;
+ break;
+ default;
+ echo 0;
+ break;
+endswitch;
+?>
+
+===DONE===
+--EXPECT--
+If: 11
+While: 12346789
+For: 0123401234
+Switch: 1
+===DONE===
diff --git a/tests/lang/034.phpt b/tests/lang/034.phpt
new file mode 100644
index 0000000..cea0797
--- /dev/null
+++ b/tests/lang/034.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #12647 (Locale settings affecting float parsing)
+--INI--
+precision=14
+--SKIPIF--
+<?php # try to activate a german locale
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ /* skip on windows until #63688 was fixed */
+ die('skip');
+}
+if (setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1") === FALSE) {
+ print "skip Can't find german locale";
+}
+?>
+--FILE--
+<?php
+# activate the german locale
+setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1");
+
+echo (float)"3.14", "\n";
+?>
+--EXPECT--
+3,14
diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt
new file mode 100644
index 0000000..9472999
--- /dev/null
+++ b/tests/lang/035.phpt
@@ -0,0 +1,38 @@
+--TEST--
+ZE2: set_exception_handler()
+--SKIPIF--
+<?php if (version_compare(zend_version(), "2.0.0-dev", "<")) print "skip Zend engine 2 required"; ?>
+--FILE--
+<?php
+class MyException extends Exception {
+ function MyException($_error) {
+ $this->error = $_error;
+ }
+
+ function getException()
+ {
+ return $this->error;
+ }
+}
+
+function ThrowException()
+{
+ throw new MyException("'This is an exception!'");
+}
+
+
+try {
+} catch (MyException $exception) {
+ print "There shouldn't be an exception: " . $exception->getException();
+ print "\n";
+}
+
+try {
+ ThrowException();
+} catch (MyException $exception) {
+ print "There was an exception: " . $exception->getException();
+ print "\n";
+}
+?>
+--EXPECT--
+There was an exception: 'This is an exception!'
diff --git a/tests/lang/036.phpt b/tests/lang/036.phpt
new file mode 100644
index 0000000..474316e
--- /dev/null
+++ b/tests/lang/036.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Child public element should not override parent private element in parent methods
+--FILE--
+<?php
+class par {
+ private $id = "foo";
+
+ function displayMe()
+ {
+ print $this->id;
+ }
+};
+
+class chld extends par {
+ public $id = "bar";
+ function displayHim()
+ {
+ parent::displayMe();
+ }
+};
+
+
+$obj = new chld();
+$obj->displayHim();
+?>
+--EXPECT--
+foo
diff --git a/tests/lang/037.phpt b/tests/lang/037.phpt
new file mode 100644
index 0000000..c2a1ee3
--- /dev/null
+++ b/tests/lang/037.phpt
@@ -0,0 +1,30 @@
+--TEST--
+'Static' binding for private variables
+--FILE--
+<?php
+
+class par {
+ private $id="foo";
+
+ function displayMe()
+ {
+ $this->displayChild();
+ }
+};
+
+class chld extends par {
+ private $id = "bar";
+
+ function displayChild()
+ {
+ print $this->id;
+ }
+};
+
+
+$obj = new chld();
+$obj->displayMe();
+
+?>
+--EXPECT--
+bar
diff --git a/tests/lang/038.phpt b/tests/lang/038.phpt
new file mode 100644
index 0000000..195050b
--- /dev/null
+++ b/tests/lang/038.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Convert warnings to exceptions
+--FILE--
+<?php
+
+class MyException extends Exception
+{
+ function __construct($errstr, $errno=0, $errfile='', $errline='')
+ {
+ parent::__construct($errstr, $errno);
+ $this->file = $errfile;
+ $this->line = $errline;
+ }
+}
+
+function Error2Exception($errno, $errstr, $errfile, $errline)
+{
+ throw new MyException($errstr, $errno);//, $errfile, $errline);
+}
+
+$err_msg = 'no exception';
+set_error_handler('Error2Exception');
+
+try
+{
+ $con = fopen("/tmp/a_file_that_does_not_exist",'r');
+}
+catch (Exception $e)
+{
+ $trace = $e->getTrace();
+ var_dump($trace[0]['function']);
+ var_dump($trace[1]['function']);
+}
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+string(15) "Error2Exception"
+string(5) "fopen"
+===DONE===
diff --git a/tests/lang/039.phpt b/tests/lang/039.phpt
new file mode 100644
index 0000000..aa4b591
--- /dev/null
+++ b/tests/lang/039.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Catch Interfaces
+--FILE--
+<?php
+
+interface Catchable
+{
+}
+
+class MyException extends Exception implements Catchable
+{
+ function __construct($errstr, $errno, $errfile, $errline)
+ {
+ parent::__construct($errstr, $errno);
+ $this->file = $errfile;
+ $this->line = $errline;
+ }
+}
+
+function Error2Exception($errno, $errstr, $errfile, $errline)
+{
+ throw new MyException($errstr, $errno, $errfile, $errline);
+}
+
+$err_msg = 'no exception';
+set_error_handler('Error2Exception');
+
+try
+{
+ $con = fopen('/tmp/a_file_that_does_not_exist','r');
+}
+catch (Catchable $e)
+{
+ echo "Catchable\n";
+}
+catch (Exception $e)
+{
+ echo "Exception\n";
+}
+
+?>
+===DONE===
+--EXPECTF--
+Catchable
+===DONE===
diff --git a/tests/lang/040.phpt b/tests/lang/040.phpt
new file mode 100644
index 0000000..6d8ece9
--- /dev/null
+++ b/tests/lang/040.phpt
@@ -0,0 +1,15 @@
+--TEST--
+foreach into array
+--FILE--
+<?php
+$a = array(0,1);
+$b[0]=2;
+foreach($a as $b[0]) {
+ echo $b[0]."\n";
+}
+?>
+===DONE===
+--EXPECT--
+0
+1
+===DONE===
diff --git a/tests/lang/041.phpt b/tests/lang/041.phpt
new file mode 100644
index 0000000..6972412
--- /dev/null
+++ b/tests/lang/041.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Dynamic access of static members
+--FILE--
+<?php
+class A {
+ public static $b = 'foo';
+}
+
+$classname = 'A';
+$wrongClassname = 'B';
+
+echo $classname::$b."\n";
+echo $wrongClassname::$b."\n";
+
+?>
+===DONE===
+--EXPECTF--
+foo
+
+Fatal error: Class 'B' not found in %s041.php on line %d
diff --git a/tests/lang/042.phpt b/tests/lang/042.phpt
new file mode 100644
index 0000000..217aab8
--- /dev/null
+++ b/tests/lang/042.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Dynamic access of constants
+--FILE--
+<?php
+class A {
+ const B = 'foo';
+}
+
+$classname = 'A';
+$wrongClassname = 'B';
+
+echo $classname::B."\n";
+echo $wrongClassname::B."\n";
+?>
+===DONE===
+--EXPECTF--
+foo
+
+Fatal error: Class 'B' not found in %s042.php on line %d
diff --git a/tests/lang/043.phpt b/tests/lang/043.phpt
new file mode 100644
index 0000000..7ca2d74
--- /dev/null
+++ b/tests/lang/043.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Dynamic call for static methods
+--FILE--
+<?php
+class A {
+ static function foo() { return 'foo'; }
+}
+
+$classname = 'A';
+$wrongClassname = 'B';
+
+echo $classname::foo()."\n";
+echo $wrongClassname::foo()."\n";
+?>
+===DONE===
+--EXPECTF--
+foo
+
+Fatal error: Class 'B' not found in %s043.php on line %d
diff --git a/tests/lang/044.phpt b/tests/lang/044.phpt
new file mode 100644
index 0000000..a0de889
--- /dev/null
+++ b/tests/lang/044.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Dynamic call for static methods dynamically named
+--FILE--
+<?php
+class A {
+ static function foo() { return 'foo'; }
+}
+$classname = 'A';
+$wrongClassname = 'B';
+
+$methodname = 'foo';
+
+echo $classname::$methodname()."\n";
+
+echo $wrongClassname::$methodname()."\n";
+?>
+===DONE===
+--EXPECTF--
+foo
+
+Fatal error: Class 'B' not found in %s044.php on line %d
diff --git a/tests/lang/045.phpt b/tests/lang/045.phpt
new file mode 100644
index 0000000..11598cf
--- /dev/null
+++ b/tests/lang/045.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Timeout again inside register_shutdown_function
+--SKIPIF--
+<?php
+if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+?>
+--FILE--
+<?php
+set_time_limit(1);
+register_shutdown_function("plop");
+
+function plop() {
+ $ts = time();
+ while(true) {
+ if ((time()-$ts) > 2) {
+ echo "Failed!";
+ break;
+ }
+ }
+}
+plop();
+?>
+===DONE===
+--EXPECTF--
+Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
+
+Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
diff --git a/tests/lang/array_shortcut_001.phpt b/tests/lang/array_shortcut_001.phpt
new file mode 100644
index 0000000..18a10ea
--- /dev/null
+++ b/tests/lang/array_shortcut_001.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Square bracket array shortcut test
+--FILE--
+<?php
+print_r([1, 2, 3]);
+?>
+--EXPECT--
+Array
+(
+ [0] => 1
+ [1] => 2
+ [2] => 3
+)
diff --git a/tests/lang/array_shortcut_002.phpt b/tests/lang/array_shortcut_002.phpt
new file mode 100644
index 0000000..25aee9b
--- /dev/null
+++ b/tests/lang/array_shortcut_002.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Square bracket associative array shortcut test
+--FILE--
+<?php
+print_r(["foo" => "orange", "bar" => "apple", "baz" => "lemon"]);
+?>
+--EXPECT--
+Array
+(
+ [foo] => orange
+ [bar] => apple
+ [baz] => lemon
+)
diff --git a/tests/lang/array_shortcut_003.phpt b/tests/lang/array_shortcut_003.phpt
new file mode 100644
index 0000000..75e428b
--- /dev/null
+++ b/tests/lang/array_shortcut_003.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing array shortcut and bracket operator
+--FILE--
+<?php
+$a = [1, 2, 3, 4, 5];
+print_r([$a[1], $a[3]]);
+?>
+--EXPECT--
+Array
+(
+ [0] => 2
+ [1] => 4
+)
diff --git a/tests/lang/array_shortcut_005.phpt b/tests/lang/array_shortcut_005.phpt
new file mode 100644
index 0000000..7cc7386
--- /dev/null
+++ b/tests/lang/array_shortcut_005.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Testing nested array shortcut
+--FILE--
+<?php
+print_r([1, 2, 3, ["foo" => "orange", "bar" => "apple", "baz" => "lemon"]]);
+?>
+--EXPECT--
+Array
+(
+ [0] => 1
+ [1] => 2
+ [2] => 3
+ [3] => Array
+ (
+ [foo] => orange
+ [bar] => apple
+ [baz] => lemon
+ )
+
+)
diff --git a/tests/lang/bison1.phpt b/tests/lang/bison1.phpt
new file mode 100644
index 0000000..3571576
--- /dev/null
+++ b/tests/lang/bison1.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bison weirdness
+--FILE--
+<?php
+error_reporting(E_ALL & ~E_NOTICE);
+echo "blah-$foo\n";
+?>
+--EXPECT--
+blah-
diff --git a/tests/lang/bug17115.phpt b/tests/lang/bug17115.phpt
new file mode 100644
index 0000000..0cb3bf4
--- /dev/null
+++ b/tests/lang/bug17115.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #17115 (lambda functions produce segfault with static vars)
+--FILE--
+<?php
+$func = create_function('','
+ static $foo = 0;
+ return $foo++;
+');
+var_dump($func());
+var_dump($func());
+var_dump($func());
+?>
+--EXPECT--
+int(0)
+int(1)
+int(2)
diff --git a/tests/lang/bug18872.phpt b/tests/lang/bug18872.phpt
new file mode 100644
index 0000000..2e3dc22
--- /dev/null
+++ b/tests/lang/bug18872.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #18872 (class constant used as default parameter)
+--FILE--
+<?php
+class FooBar {
+ const BIFF = 3;
+}
+
+function foo($biff = FooBar::BIFF) {
+ echo $biff . "\n";
+}
+
+foo();
+foo();
+?>
+--EXPECT--
+3
+3
diff --git a/tests/lang/bug19566.phpt b/tests/lang/bug19566.phpt
new file mode 100644
index 0000000..45c3bc5
--- /dev/null
+++ b/tests/lang/bug19566.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #19566 (get_declared_classes() segfaults)
+--FILE--
+<?php
+class foo {}
+$result = get_declared_classes();
+var_dump(array_search('foo', $result));
+?>
+--EXPECTF--
+int(%d)
diff --git a/tests/lang/bug19943.phpt b/tests/lang/bug19943.phpt
new file mode 100644
index 0000000..c951190
--- /dev/null
+++ b/tests/lang/bug19943.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #19943 (memleaks)
+--FILE--
+<?php
+ $ar = array();
+ for ($count = 0; $count < 10; $count++) {
+ $ar[$count] = "$count";
+ @$ar[$count]['idx'] = "$count";
+ }
+
+ for ($count = 0; $count < 10; $count++) {
+ echo $ar[$count]." -- ".@$ar[$count]['idx']."\n";
+ }
+ $a = "0123456789";
+ $a[9] = $a[0];
+ var_dump($a);
+?>
+--EXPECT--
+0 -- 0
+1 -- 1
+2 -- 2
+3 -- 3
+4 -- 4
+5 -- 5
+6 -- 6
+7 -- 7
+8 -- 8
+9 -- 9
+string(10) "0123456780"
diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt
new file mode 100644
index 0000000..7c6ec78
--- /dev/null
+++ b/tests/lang/bug20175.phpt
@@ -0,0 +1,169 @@
+--TEST--
+Bug #20175 (Static vars can't store ref to new instance)
+--SKIPIF--
+<?php if (version_compare(zend_version(),'2.0.0-dev','<')) die('skip ZE1 does not have static class members'); ?>
+--INI--
+error_reporting=E_ALL | E_STRICT | E_DEPRECATED
+--FILE--
+<?php
+print zend_version()."\n";
+
+/* Part 1:
+ * Storing the result of a function in a static variable.
+ * foo_global() increments global variable $foo_count whenever it is executed.
+ * When foo_static() is called it checks for the static variable $foo_value
+ * being initialised. In case initialisation is necessary foo_global() will be
+ * called. Since that must happen only once the return value should be equal.
+ */
+$foo_count = 0;
+
+function foo_global() {
+ global $foo_count;
+ echo "foo_global()\n";
+ return 'foo:' . ++$foo_count;
+}
+
+function foo_static() {
+ static $foo_value;
+ echo "foo_static()\n";
+ if (!isset($foo_value)) {
+ $foo_value = foo_global();
+ }
+ return $foo_value;
+}
+
+/* Part 2:
+ * Storing a reference to the result of a function in a static variable.
+ * Same as Part 1 but:
+ * The return statment transports a copy of the value to return. In other
+ * words the return value of bar_global() is a temporary variable only valid
+ * after the function call bar_global() is done in current local scope.
+ */
+$bar_count = 0;
+
+function bar_global() {
+ global $bar_count;
+ echo "bar_global()\n";
+ return 'bar:' . ++$bar_count;
+}
+
+function bar_static() {
+ static $bar_value;
+ echo "bar_static()\n";
+ if (!isset($bar_value)) {
+ $bar_value = &bar_global();
+ }
+ return $bar_value;
+}
+
+/* Part 3: TO BE DISCUSSED
+ *
+ * Storing a reference to the result of a function in a static variable.
+ * Same as Part 2 but wow_global() returns a reference so $wow_value
+ * should store a reference to $wow_global. Therefor $wow_value is already
+ * initialised in second call to wow_static() and hence shouldn't call
+ * wow_global() again.
+ */ /*
+$wow_count = 0;
+$wow_name = '';
+
+function &wow_global() {
+ global $wow_count, $wow_name;
+ echo "wow_global()\n";
+ $wow_name = 'wow:' . ++$wow_count;
+ return $wow_name;
+}
+
+function wow_static() {
+ static $wow_value;
+ echo "wow_static()\n";
+ if (!isset($wow_value)) {
+ $wow_value = &wow_global();
+ }
+ return $wow_value;
+}*/
+
+/* Part 4:
+ * Storing a reference to a new instance (that's where the name of the test
+ * comes from). First there is the global counter $oop_global again which
+ * counts the calls to the constructor of oop_class and hence counts the
+ * creation of oop_class instances.
+ * The class oop_test uses a static reference to a oop_class instance.
+ * When another oop_test instance is created it must reuse the statically
+ * stored reference oop_value. This way oop_class gets some singleton behavior
+ * since it will be created only once for all insatnces of oop_test.
+ */
+$oop_global = 0;
+class oop_class {
+ var $oop_name;
+
+ function oop_class() {
+ global $oop_global;
+ echo "oop_class()\n";
+ $this->oop_name = 'oop:' . ++$oop_global;
+ }
+}
+
+class oop_test {
+ static $oop_value;
+
+ function oop_test() {
+ echo "oop_test()\n";
+ }
+
+ function oop_static() {
+ echo "oop_static()\n";
+ if (!isset(self::$oop_value)) {
+ self::$oop_value = & new oop_class;
+ }
+ echo self::$oop_value->oop_name;
+ }
+}
+
+print foo_static()."\n";
+print foo_static()."\n";
+print bar_static()."\n";
+print bar_static()."\n";
+//print wow_static()."\n";
+//print wow_static()."\n";
+echo "wow_static()
+wow_global()
+wow:1
+wow_static()
+wow:1
+";
+$oop_tester = new oop_test;
+print $oop_tester->oop_static()."\n";
+print $oop_tester->oop_static()."\n";
+$oop_tester = new oop_test; // repeated.
+print $oop_tester->oop_static()."\n";
+?>
+--EXPECTF--
+Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line %d
+%s
+foo_static()
+foo_global()
+foo:1
+foo_static()
+foo:1
+bar_static()
+bar_global()
+
+Strict Standards: Only variables should be assigned by reference in %sbug20175.php on line 47
+bar:1
+bar_static()
+bar:1
+wow_static()
+wow_global()
+wow:1
+wow_static()
+wow:1
+oop_test()
+oop_static()
+oop_class()
+oop:1
+oop_static()
+oop:1
+oop_test()
+oop_static()
+oop:1
diff --git a/tests/lang/bug21094.phpt b/tests/lang/bug21094.phpt
new file mode 100644
index 0000000..266a1d6
--- /dev/null
+++ b/tests/lang/bug21094.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #21094 (set_error_handler not accepting methods)
+--FILE--
+<?php
+class test {
+ function hdlr($errno, $errstr, $errfile, $errline) {
+ printf("[%d] errstr: %s, errfile: %s, errline: %d\n", $errno, $errstr, $errfile, $errline, $errstr);
+ }
+}
+
+set_error_handler(array(new test(), "hdlr"));
+
+trigger_error("test");
+?>
+--EXPECTF--
+[1024] errstr: test, errfile: %s, errline: %d
+
diff --git a/tests/lang/bug21600.phpt b/tests/lang/bug21600.phpt
new file mode 100644
index 0000000..6ecf69a
--- /dev/null
+++ b/tests/lang/bug21600.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #21600 (assign by reference function call changes variable contents)
+--INI--
+error_reporting=4095
+--FILE--
+<?php
+$tmp = array();
+$tmp['foo'] = "test";
+$tmp['foo'] = &bar($tmp['foo']);
+var_dump($tmp);
+
+unset($tmp);
+
+$tmp = array();
+$tmp['foo'] = "test";
+$tmp['foo'] = &fubar($tmp['foo']);
+var_dump($tmp);
+
+function bar($text){
+ return $text;
+}
+
+function fubar($text){
+ $text = &$text;
+ return $text;
+}
+?>
+--EXPECTF--
+Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 4
+array(1) {
+ ["foo"]=>
+ string(4) "test"
+}
+
+Strict Standards: Only variables should be assigned by reference in %sbug21600.php on line 11
+array(1) {
+ ["foo"]=>
+ string(4) "test"
+}
diff --git a/tests/lang/bug21669.phpt b/tests/lang/bug21669.phpt
new file mode 100644
index 0000000..643b069
--- /dev/null
+++ b/tests/lang/bug21669.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #21669 ("$obj = new $this->var;" doesn't work)
+--FILE--
+<?php
+class Test {
+ function say_hello() {
+ echo "Hello world";
+ }
+}
+
+class Factory {
+ public $name = "Test";
+ function create() {
+ $obj = new $this->name; /* Parse error */
+ return $obj;
+ }
+}
+$factory = new Factory;
+$test = $factory->create();
+$test->say_hello();
+?>
+--EXPECT--
+Hello world
diff --git a/tests/lang/bug21820.phpt b/tests/lang/bug21820.phpt
new file mode 100644
index 0000000..cbf466e
--- /dev/null
+++ b/tests/lang/bug21820.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #21820 ("$arr['foo']" generates bogus E_NOTICE, should be E_PARSE)
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+$arr = array('foo' => 'bar');
+echo "$arr['foo']";
+
+?>
+--EXPECTF--
+Parse error: %s error, %s(T_STRING)%s(T_VARIABLE)%s(T_NUM_STRING)%sin %sbug21820.php on line %d
diff --git a/tests/lang/bug21849.phpt b/tests/lang/bug21849.phpt
new file mode 100644
index 0000000..30b3113
--- /dev/null
+++ b/tests/lang/bug21849.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #21849 (self::constant doesn't work as method's default parameter)
+--FILE--
+<?php
+class foo {
+ const bar = "fubar\n";
+
+ function foo($arg = self::bar) {
+ echo $arg;
+ }
+}
+
+new foo();
+?>
+--EXPECT--
+fubar
diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt
new file mode 100644
index 0000000..24581d6
--- /dev/null
+++ b/tests/lang/bug21961.phpt
@@ -0,0 +1,58 @@
+--TEST--
+Bug #21961 (get_parent_class() segfault)
+--SKIPIF--
+<?php if (version_compare(zend_version(),'2.0.0-dev','<')) die('skip prepared for ZE2'); ?>
+--FILE--
+<?php
+
+class man
+{
+ public $name, $bars;
+ function man()
+ {
+ $this->name = 'Mr. X';
+ $this->bars = array();
+ }
+
+ function getdrunk($where)
+ {
+ $this->bars[] = new bar($where);
+ }
+
+ function getName()
+ {
+ return $this->name;
+ }
+}
+
+class bar extends man
+{
+ public $name;
+
+ function bar($w)
+ {
+ $this->name = $w;
+ }
+
+ function getName()
+ {
+ return $this->name;
+ }
+
+ function whosdrunk()
+ {
+ $who = get_parent_class($this);
+ if($who == NULL)
+ {
+ return 'nobody';
+ }
+ return eval("return ".$who.'::getName();');
+ }
+}
+
+$x = new man;
+$x->getdrunk('The old Tavern');
+var_dump($x->bars[0]->whosdrunk());
+?>
+--EXPECT--
+string(14) "The old Tavern"
diff --git a/tests/lang/bug22231.phpt b/tests/lang/bug22231.phpt
new file mode 100644
index 0000000..ede6a37
--- /dev/null
+++ b/tests/lang/bug22231.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #22231 (segfault when returning a global variable by reference)
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+class foo {
+ public $fubar = 'fubar';
+}
+
+function &foo(){
+ $GLOBALS['foo'] = &new foo();
+ return $GLOBALS['foo'];
+}
+$bar = &foo();
+var_dump($bar);
+var_dump($bar->fubar);
+unset($bar);
+$bar = &foo();
+var_dump($bar->fubar);
+
+$foo = &foo();
+var_dump($foo);
+var_dump($foo->fubar);
+unset($foo);
+$foo = &foo();
+var_dump($foo->fubar);
+?>
+--EXPECTF--
+Deprecated: Assigning the return value of new by reference is deprecated in %s on line %d
+object(foo)#%d (1) {
+ ["fubar"]=>
+ string(5) "fubar"
+}
+string(5) "fubar"
+string(5) "fubar"
+object(foo)#%d (1) {
+ ["fubar"]=>
+ string(5) "fubar"
+}
+string(5) "fubar"
+string(5) "fubar"
diff --git a/tests/lang/bug22510.phpt b/tests/lang/bug22510.phpt
new file mode 100644
index 0000000..fd71714
--- /dev/null
+++ b/tests/lang/bug22510.phpt
@@ -0,0 +1,126 @@
+--TEST--
+Bug #22510 (segfault among complex references)
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+class foo
+{
+ public $list = array();
+
+ function finalize() {
+ print __CLASS__."::".__FUNCTION__."\n";
+ $cl = &$this->list;
+ }
+
+ function &method1() {
+ print __CLASS__."::".__FUNCTION__."\n";
+ return @$this->foo;
+ }
+
+ function &method2() {
+ print __CLASS__."::".__FUNCTION__."\n";
+ return $this->foo;
+ }
+
+ function method3() {
+ print __CLASS__."::".__FUNCTION__."\n";
+ return @$this->foo;
+ }
+}
+
+class bar
+{
+ function run1() {
+ print __CLASS__."::".__FUNCTION__."\n";
+ $this->instance = new foo();
+ $this->instance->method1($this);
+ $this->instance->method1($this);
+ }
+
+ function run2() {
+ print __CLASS__."::".__FUNCTION__."\n";
+ $this->instance = new foo();
+ $this->instance->method2($this);
+ $this->instance->method2($this);
+ }
+
+ function run3() {
+ print __CLASS__."::".__FUNCTION__."\n";
+ $this->instance = new foo();
+ $this->instance->method3($this);
+ $this->instance->method3($this);
+ }
+}
+
+function ouch(&$bar) {
+ print __FUNCTION__."\n";
+ @$a = $a;
+ $bar->run1();
+}
+
+function ok1(&$bar) {
+ print __FUNCTION__."\n";
+ $bar->run1();
+}
+
+function ok2(&$bar) {
+ print __FUNCTION__."\n";
+ @$a = $a;
+ $bar->run2();
+}
+
+function ok3(&$bar) {
+ print __FUNCTION__."\n";
+ @$a = $a;
+ $bar->run3();
+}
+
+$bar = &new bar();
+ok1($bar);
+$bar->instance->finalize();
+print "done!\n";
+ok2($bar);
+$bar->instance->finalize();
+print "done!\n";
+ok3($bar);
+$bar->instance->finalize();
+print "done!\n";
+ouch($bar);
+$bar->instance->finalize();
+print "I'm alive!\n";
+?>
+--EXPECTF--
+Deprecated: Assigning the return value of new by reference is deprecated in %s on line %d
+ok1
+bar::run1
+foo::method1
+
+Notice: Only variable references should be returned by reference in %s on line %d
+foo::method1
+
+Notice: Only variable references should be returned by reference in %s on line %d
+foo::finalize
+done!
+ok2
+bar::run2
+foo::method2
+foo::method2
+foo::finalize
+done!
+ok3
+bar::run3
+foo::method3
+foo::method3
+foo::finalize
+done!
+ouch
+bar::run1
+foo::method1
+
+Notice: Only variable references should be returned by reference in %s on line %d
+foo::method1
+
+Notice: Only variable references should be returned by reference in %s on line %d
+foo::finalize
+I'm alive!
diff --git a/tests/lang/bug22592.phpt b/tests/lang/bug22592.phpt
new file mode 100644
index 0000000..2705841
--- /dev/null
+++ b/tests/lang/bug22592.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Bug #22592 (cascading assignments to strings with curly braces broken)
+--FILE--
+<?php
+function error_hdlr($errno, $errstr) {
+ echo "[$errstr]\n";
+}
+
+set_error_handler('error_hdlr');
+
+$i = 4;
+$s = "string";
+
+$result = "* *-*";
+var_dump($result);
+$result[6] = '*';
+var_dump($result);
+$result[1] = $i;
+var_dump($result);
+$result[3] = $s;
+var_dump($result);
+$result[7] = 0;
+var_dump($result);
+$a = $result[1] = $result[3] = '-';
+var_dump($result);
+$b = $result[3] = $result[5] = $s;
+var_dump($result);
+$c = $result[0] = $result[2] = $result[4] = $i;
+var_dump($result);
+$d = $result[6] = $result[8] = 5;
+var_dump($result);
+$e = $result[1] = $result[6];
+var_dump($result);
+var_dump($a, $b, $c, $d, $e);
+$result[-1] = 'a';
+?>
+--EXPECT--
+string(5) "* *-*"
+string(7) "* *-* *"
+string(7) "*4*-* *"
+string(7) "*4*s* *"
+string(8) "*4*s* *0"
+string(8) "*-*-* *0"
+string(8) "*-*s*s*0"
+string(8) "4-4s4s*0"
+string(9) "4-4s4s505"
+string(9) "454s4s505"
+string(1) "-"
+string(1) "s"
+string(1) "4"
+string(1) "5"
+string(1) "5"
+[Illegal string offset: -1]
diff --git a/tests/lang/bug22690.phpt b/tests/lang/bug22690.phpt
new file mode 100644
index 0000000..6aed5be
--- /dev/null
+++ b/tests/lang/bug22690.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #22690 (ob_start() is broken with create_function() callbacks)
+--FILE--
+<?php
+ $foo = create_function('$s', 'return strtoupper($s);');
+ ob_start($foo);
+ echo $foo("bar\n");
+?>
+bar
+--EXPECT--
+BAR
+BAR
diff --git a/tests/lang/bug23279.phpt b/tests/lang/bug23279.phpt
new file mode 100644
index 0000000..78d7850
--- /dev/null
+++ b/tests/lang/bug23279.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #23279 (exception handler stops after first function call)
+--FILE--
+<?php
+ob_start();
+set_exception_handler('redirect_on_error');
+echo "Hello World\n";
+throw new Exception;
+
+function redirect_on_error($e) {
+ ob_end_clean();
+ echo "Goodbye Cruel World\n";
+}
+?>
+--EXPECT--
+Goodbye Cruel World
diff --git a/tests/lang/bug23384.phpt b/tests/lang/bug23384.phpt
new file mode 100644
index 0000000..382bdfe
--- /dev/null
+++ b/tests/lang/bug23384.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #23384 (use of class constants in statics)
+--INI--
+error_reporting=4095
+--FILE--
+<?php
+define('TEN', 10);
+class Foo {
+ const HUN = 100;
+ function test($x = Foo::HUN) {
+ static $arr2 = array(TEN => 'ten');
+ static $arr = array(Foo::HUN => 'ten');
+
+ print_r($arr);
+ print_r($arr2);
+ print_r($x);
+ }
+}
+
+Foo::test();
+echo Foo::HUN."\n";
+?>
+--EXPECTF--
+Strict Standards: Non-static method Foo::test() should not be called statically in %sbug23384.php on line %d
+Array
+(
+ [100] => ten
+)
+Array
+(
+ [10] => ten
+)
+100100
diff --git a/tests/lang/bug23489.phpt b/tests/lang/bug23489.phpt
new file mode 100644
index 0000000..645bb1b
--- /dev/null
+++ b/tests/lang/bug23489.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #23489 (ob_start() is broken with method callbacks)
+--FILE--
+<?php
+class Test {
+ function Test() {
+ ob_start(
+ array(
+ $this, 'transform'
+ )
+ );
+ }
+
+ function transform($buffer) {
+ return 'success';
+ }
+}
+
+$t = new Test;
+?>
+failure
+--EXPECT--
+success
diff --git a/tests/lang/bug23524.phpt b/tests/lang/bug23524.phpt
new file mode 100644
index 0000000..512c714
--- /dev/null
+++ b/tests/lang/bug23524.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #23524 (Improper handling of constants in array indices)
+--FILE--
+<?php
+ echo "Begin\n";
+ define("THE_CONST",123);
+ function f($a=array(THE_CONST=>THE_CONST)) {
+ print_r($a);
+ }
+ f();
+ f();
+ f();
+ echo "Done";
+?>
+--EXPECT--
+Begin
+Array
+(
+ [123] => 123
+)
+Array
+(
+ [123] => 123
+)
+Array
+(
+ [123] => 123
+)
+Done
diff --git a/tests/lang/bug23584.phpt b/tests/lang/bug23584.phpt
new file mode 100644
index 0000000..417cfb0
--- /dev/null
+++ b/tests/lang/bug23584.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #23584 (error line numbers off by one when using #!php)
+--FILE--
+#!php
+<?php
+
+error_reporting(E_ALL);
+
+echo $foo;
+
+?>
+--EXPECTREGEX--
+Notice: Undefined variable:.*foo in .* on line 6
diff --git a/tests/lang/bug23624.phpt b/tests/lang/bug23624.phpt
new file mode 100644
index 0000000..4ddb82e
--- /dev/null
+++ b/tests/lang/bug23624.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #23624 (foreach leaves current array key as null)
+--FILE--
+<?php
+ $arr = array ('one', 'two', 'three');
+ var_dump(current($arr));
+ foreach($arr as $key => $value);
+ var_dump(current($arr));
+?>
+--EXPECT--
+string(3) "one"
+bool(false)
diff --git a/tests/lang/bug23922.phpt b/tests/lang/bug23922.phpt
new file mode 100644
index 0000000..1fc6e54
--- /dev/null
+++ b/tests/lang/bug23922.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #23922 (scope doesn't properly propagate into internal functions)
+--FILE--
+<?php
+ class foo
+ {
+ public $foo = 1;
+
+ function as_string()
+ { assert('$this->foo == 1'); }
+
+ function as_expr()
+ { assert($this->foo == 1); }
+ }
+
+ $foo = new foo();
+ $foo->as_expr();
+ $foo->as_string();
+?>
+--EXPECT--
diff --git a/tests/lang/bug24054.phpt b/tests/lang/bug24054.phpt
new file mode 100644
index 0000000..fc51c83
--- /dev/null
+++ b/tests/lang/bug24054.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #24054 (Assignment operator *= broken)
+--FILE--
+<?php // $Id$
+
+define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF);
+define('LONG_MIN', -LONG_MAX - 1);
+printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ),
+ is_int(LONG_MIN-1),is_int(LONG_MAX+1));
+
+ $i = LONG_MAX;
+
+ $j = $i * 1001;
+ $i *= 1001;
+
+$tests = <<<TESTS
+$i === $j
+TESTS;
+
+include(dirname(__FILE__) . '/../quicktester.inc');
+
+--EXPECT--
+1,1,0,0
+OK
diff --git a/tests/lang/bug24396.phpt b/tests/lang/bug24396.phpt
new file mode 100644
index 0000000..b78e4b8
--- /dev/null
+++ b/tests/lang/bug24396.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #24396 (global $$variable broken)
+--FILE--
+<?php
+
+$arr = array('a' => 1, 'b' => 2, 'c' => 3);
+
+foreach($arr as $k=>$v) {
+ global $$k; // comment this out and it works in PHP 5 too..
+
+ echo "($k => $v)\n";
+
+ $$k = $v;
+}
+?>
+--EXPECT--
+(a => 1)
+(b => 2)
+(c => 3)
diff --git a/tests/lang/bug24403.phpt b/tests/lang/bug24403.phpt
new file mode 100644
index 0000000..fe99257
--- /dev/null
+++ b/tests/lang/bug24403.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #24403 (scope doesn't properly propagate into internal functions)
+--FILE--
+<?php
+class a
+{
+ public $a = array();
+
+ function a()
+ {
+ $output = preg_replace(
+ '!\{\s*([a-z0-9_]+)\s*\}!sie',
+ "(in_array('\\1',\$this->a) ? '\'.\$p[\'\\1\'].\'' :
+'\'.\$r[\'\\1\'].\'')",
+ "{a} b {c}");
+ }
+}
+new a();
+?>
+--EXPECT--
diff --git a/tests/lang/bug24436.phpt b/tests/lang/bug24436.phpt
new file mode 100644
index 0000000..b0cfbe0
--- /dev/null
+++ b/tests/lang/bug24436.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #24436 (isset() and empty() produce errors with non-existent variables in objects)
+--FILE--
+<?php
+class test {
+ function __construct() {
+ if (empty($this->test[0][0])) { print "test1";}
+ if (!isset($this->test[0][0])) { print "test2";}
+ }
+}
+
+$test1 = new test();
+?>
+--EXPECT--
+test1test2
diff --git a/tests/lang/bug24499.phpt b/tests/lang/bug24499.phpt
new file mode 100644
index 0000000..6ce56db
--- /dev/null
+++ b/tests/lang/bug24499.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #24499 (bogus handling of a public property as a private one)
+--FILE--
+<?php
+class Id {
+ private $id="priv";
+
+ public function tester($obj)
+ {
+ $obj->id = "bar";
+ }
+}
+
+$id = new Id();
+@$obj->foo = "bar";
+$id->tester($obj);
+print_r($obj);
+?>
+--EXPECT--
+stdClass Object
+(
+ [foo] => bar
+ [id] => bar
+)
diff --git a/tests/lang/bug24573.phpt b/tests/lang/bug24573.phpt
new file mode 100644
index 0000000..e087d1f
--- /dev/null
+++ b/tests/lang/bug24573.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #24573 (debug_backtrace() crashes if $this is set to null)
+--FILE--
+<?php
+
+class Foo {
+ function Bar() {
+ $__this = $this;
+ $this = null;
+ debug_backtrace();
+ $this = $__this;
+ }
+}
+
+$f = new Foo;
+
+$f->Bar();
+
+echo "OK\n";
+
+?>
+--EXPECTF--
+
+Fatal error: Cannot re-assign $this in %s on line %d \ No newline at end of file
diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt
new file mode 100644
index 0000000..919b38e
--- /dev/null
+++ b/tests/lang/bug24640.phpt
@@ -0,0 +1,129 @@
+--TEST--
+Bug #24640 (var_export and var_dump can't output large float)
+--INI--
+precision=12
+--FILE--
+<?php
+function test($v)
+{
+ echo var_export($v, true) . "\n";
+ var_dump($v);
+ echo "$v\n";
+ print_r($v);
+ echo "\n------\n";
+}
+
+test(1.7e+300);
+test(1.7e-300);
+test(1.7e+79);
+test(1.7e-79);
+test(1.7e+80);
+test(1.7e-80);
+test(1.7e+81);
+test(1.7e-81);
+test(1.7e+319);
+test(1.7e-319);
+test(1.7e+320);
+test(1.7e-320);
+test(1.7e+321);
+test(1.7e-321);
+test(1.7e+324);
+test(1.7e-324);
+test(1.7e+1000);
+test(1.7e-1000);
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+1.7E+300
+float(1.7E+300)
+1.7E+300
+1.7E+300
+------
+1.7E-300
+float(1.7E-300)
+1.7E-300
+1.7E-300
+------
+1.7E+79
+float(1.7E+79)
+1.7E+79
+1.7E+79
+------
+1.7E-79
+float(1.7E-79)
+1.7E-79
+1.7E-79
+------
+1.7E+80
+float(1.7E+80)
+1.7E+80
+1.7E+80
+------
+1.7E-80
+float(1.7E-80)
+1.7E-80
+1.7E-80
+------
+1.7E+81
+float(1.7E+81)
+1.7E+81
+1.7E+81
+------
+1.7E-81
+float(1.7E-81)
+1.7E-81
+1.7E-81
+------
+I%s
+float(I%s)
+I%s
+I%s
+------
+1.69998107421E-319
+float(1.69998107421E-319)
+1.69998107421E-319
+1.69998107421E-319
+------
+I%s
+float(I%s)
+I%s
+I%s
+------
+1.70007988734E-320
+float(1.70007988734E-320)
+1.70007988734E-320
+1.70007988734E-320
+------
+I%s
+float(I%s)
+I%s
+I%s
+------
+1.69958582169E-321
+float(1.69958582169E-321)
+1.69958582169E-321
+1.69958582169E-321
+------
+I%s
+float(I%s)
+I%s
+I%s
+------
+0
+float(0)
+0
+0
+------
+I%s
+float(I%s)
+I%s
+I%s
+------
+0
+float(0)
+0
+0
+------
+===DONE===
diff --git a/tests/lang/bug24652.phpt b/tests/lang/bug24652.phpt
new file mode 100644
index 0000000..3bcea0e
--- /dev/null
+++ b/tests/lang/bug24652.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Bug #24652 (broken array_flip())
+--FILE--
+<?php
+ /* This works */
+ $f = array('7' => 0);
+ var_dump($f);
+ var_dump(array_key_exists(7, $f));
+ var_dump(array_key_exists('7', $f));
+
+ print "----------\n";
+ /* This doesn't */
+ $f = array_flip(array('7'));
+ var_dump($f);
+ var_dump(array_key_exists(7, $f));
+ var_dump(array_key_exists('7', $f));
+?>
+--EXPECT--
+array(1) {
+ [7]=>
+ int(0)
+}
+bool(true)
+bool(true)
+----------
+array(1) {
+ [7]=>
+ int(0)
+}
+bool(true)
+bool(true)
diff --git a/tests/lang/bug24658.phpt b/tests/lang/bug24658.phpt
new file mode 100644
index 0000000..944fe44
--- /dev/null
+++ b/tests/lang/bug24658.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Bug #24658 (combo of typehint / reference causes crash)
+--FILE--
+<?php
+class foo {}
+function no_typehint($a) {
+ var_dump($a);
+}
+function typehint(foo $a) {
+ var_dump($a);
+}
+function no_typehint_ref(&$a) {
+ var_dump($a);
+}
+function typehint_ref(foo &$a) {
+ var_dump($a);
+}
+$v = new foo();
+$a = array(new foo(), 1, 2);
+no_typehint($v);
+typehint($v);
+no_typehint_ref($v);
+typehint_ref($v);
+echo "===no_typehint===\n";
+array_walk($a, 'no_typehint');
+echo "===no_typehint_ref===\n";
+array_walk($a, 'no_typehint_ref');
+echo "===typehint===\n";
+array_walk($a, 'typehint');
+echo "===typehint_ref===\n";
+array_walk($a, 'typehint_ref');
+?>
+--EXPECTF--
+object(foo)#%d (0) {
+}
+object(foo)#%d (0) {
+}
+object(foo)#%d (0) {
+}
+object(foo)#%d (0) {
+}
+===no_typehint===
+object(foo)#%d (0) {
+}
+int(1)
+int(2)
+===no_typehint_ref===
+object(foo)#%d (0) {
+}
+int(1)
+int(2)
+===typehint===
+object(foo)#%d (0) {
+}
+
+Catchable fatal error: Argument 1 passed to typehint() must be an instance of foo, integer given in %s on line %d
diff --git a/tests/lang/bug24783.phpt b/tests/lang/bug24783.phpt
new file mode 100644
index 0000000..8c8cd6e
--- /dev/null
+++ b/tests/lang/bug24783.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #24783 ($key not binary safe in "foreach($arr as $key => $val)")
+--FILE--
+<?php
+error_reporting(E_ALL);
+ $arr = array ("foo\0bar" => "foo\0bar");
+ foreach ($arr as $key => $val) {
+ echo strlen($key), ': ';
+ echo urlencode($key), ' => ', urlencode($val), "\n";
+ }
+?>
+--EXPECT--
+7: foo%00bar => foo%00bar
diff --git a/tests/lang/bug24908.phpt b/tests/lang/bug24908.phpt
new file mode 100644
index 0000000..30056ab
--- /dev/null
+++ b/tests/lang/bug24908.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #24908 (super-globals can not be used in __destruct())
+--INI--
+variables_order=GPS
+--FILE--
+<?php
+class test {
+ function __construct() {
+ if (count($_SERVER)) echo "O";
+ }
+ function __destruct() {
+ if (count($_SERVER)) echo "K\n";
+ }
+}
+$test = new test();
+?>
+--EXPECT--
+OK
diff --git a/tests/lang/bug24926.phpt b/tests/lang/bug24926.phpt
new file mode 100644
index 0000000..3d2cc70
--- /dev/null
+++ b/tests/lang/bug24926.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #24926 (lambda function (create_function()) cannot be stored in a class property)
+--FILE--
+<?php
+
+error_reporting (E_ALL);
+
+class foo {
+
+ public $functions = array();
+
+ function foo()
+ {
+ $function = create_function('', 'return "FOO\n";');
+ print($function());
+
+ $this->functions['test'] = $function;
+ print($this->functions['test']()); // werkt al niet meer
+
+ }
+}
+
+$a = new foo ();
+
+?>
+--EXPECT--
+FOO
+FOO
diff --git a/tests/lang/bug24951.phpt b/tests/lang/bug24951.phpt
new file mode 100644
index 0000000..aa48ab2
--- /dev/null
+++ b/tests/lang/bug24951.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #24951 (ob_flush() destroys output handler)
+--FILE--
+<?php
+function test($s, $mode)
+{
+ return (($mode & PHP_OUTPUT_HANDLER_START)?"[":"") . $s . (($mode & PHP_OUTPUT_HANDLER_END)?"]\n":"");
+}
+function t1()
+{
+ ob_start("test");
+ echo "Hello from t1 1 ";
+ echo "Hello from t1 2 ";
+ ob_end_flush();
+}
+function t2()
+{
+ ob_start("test");
+ echo "Hello from t2 1 ";
+ ob_flush();
+ echo "Hello from t2 2 ";
+ ob_end_flush();
+}
+function t3()
+{
+ ob_start("test");
+ echo "Hello from t3 1 ";
+ ob_clean();
+ echo "Hello from t3 2 ";
+ ob_end_flush();
+}
+
+t1(); echo "\n";
+t2(); echo "\n";
+t3(); echo "\n";
+?>
+--EXPECT--
+[Hello from t1 1 Hello from t1 2 ]
+
+[Hello from t2 1 Hello from t2 2 ]
+
+Hello from t3 2 ]
diff --git a/tests/lang/bug25145.phpt b/tests/lang/bug25145.phpt
new file mode 100644
index 0000000..9c53387
--- /dev/null
+++ b/tests/lang/bug25145.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #25145 (SEGV on recpt of form input with name like "123[]")
+--GET--
+123[]=SEGV
+--FILE--
+<?php
+
+var_dump($_REQUEST);
+echo "Done\n";
+
+?>
+--EXPECT--
+array(1) {
+ [123]=>
+ array(1) {
+ [0]=>
+ string(4) "SEGV"
+ }
+}
+Done
diff --git a/tests/lang/bug25547.phpt b/tests/lang/bug25547.phpt
new file mode 100644
index 0000000..b54f467
--- /dev/null
+++ b/tests/lang/bug25547.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #25547 (error_handler and array index with function call)
+--FILE--
+<?php
+
+function handler($errno, $errstr, $errfile, $errline, $context)
+{
+ echo __FUNCTION__ . "($errstr)\n";
+}
+
+set_error_handler('handler');
+
+function foo($x) {
+ return "foo";
+}
+
+$output = array();
+++$output[foo("bar")];
+
+print_r($output);
+
+echo "Done";
+?>
+--EXPECT--
+handler(Undefined index: foo)
+Array
+(
+ [foo] => 1
+)
+Done
diff --git a/tests/lang/bug25652.phpt b/tests/lang/bug25652.phpt
new file mode 100644
index 0000000..09cfc18
--- /dev/null
+++ b/tests/lang/bug25652.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #25652 (Calling Global functions dynamically fails from Class scope)
+--FILE--
+<?php
+
+ function testfunc ($var) {
+ echo "testfunc $var\n";
+ }
+
+ class foo {
+ public $arr = array('testfunc');
+ function bar () {
+ $this->arr[0]('testvalue');
+ }
+ }
+
+ $a = new foo ();
+ $a->bar ();
+
+?>
+--EXPECT--
+testfunc testvalue
diff --git a/tests/lang/bug25922.phpt b/tests/lang/bug25922.phpt
new file mode 100644
index 0000000..bb030c9
--- /dev/null
+++ b/tests/lang/bug25922.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #25922 (SEGV in error_handler when context is destroyed)
+--INI--
+error_reporting=2047
+--FILE--
+<?php
+function my_error_handler($error, $errmsg='', $errfile='', $errline=0, $errcontext='')
+{
+ echo "$errmsg\n";
+ $errcontext = '';
+}
+
+set_error_handler('my_error_handler');
+
+function test()
+{
+ echo "Undefined index here: '{$data['HTTP_HEADER']}'\n";
+}
+test();
+?>
+--EXPECT--
+Undefined variable: data
+Undefined index here: ''
diff --git a/tests/lang/bug26182.phpt b/tests/lang/bug26182.phpt
new file mode 100644
index 0000000..7417293
--- /dev/null
+++ b/tests/lang/bug26182.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #26182 (Object properties created redundantly)
+--INI--
+error_reporting=4095
+--FILE--
+<?php
+
+class A {
+ function NotAConstructor ()
+ {
+ if (isset($this->x)) {
+ //just for demo
+ }
+ }
+}
+
+$t = new A ();
+
+print_r($t);
+
+?>
+--EXPECT--
+A Object
+(
+)
diff --git a/tests/lang/bug26696.phpt b/tests/lang/bug26696.phpt
new file mode 100644
index 0000000..dae182d
--- /dev/null
+++ b/tests/lang/bug26696.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #26696 (string index in a switch() crashes with multiple matches)
+--FILE--
+<?php
+
+$str = 'asdd/?';
+$len = strlen($str);
+for ($i = 0; $i < $len; $i++) {
+ switch ($str[$i]) {
+ case '?':
+ echo "OK\n";
+ break;
+ }
+}
+
+$str = '*';
+switch ($str[0]) {
+ case '*';
+ echo "OK\n";
+ break;
+ default:
+ echo 'Default RAN!';
+}
+
+?>
+--EXPECT--
+OK
+OK
diff --git a/tests/lang/bug26866.phpt b/tests/lang/bug26866.phpt
new file mode 100644
index 0000000..abb99c3
--- /dev/null
+++ b/tests/lang/bug26866.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #26866 (segfault when exception raised in __get)
+--FILE--
+<?php
+class bar {
+ function get_name() {
+ return 'bar';
+ }
+}
+class foo {
+ function __get($sName) {
+ throw new Exception('Exception!');
+ return new bar();
+ }
+}
+$foo = new foo();
+try {
+ echo $foo->bar->get_name();
+}
+catch (Exception $E) {
+ echo "Exception raised!\n";
+}
+?>
+--EXPECT--
+Exception raised!
diff --git a/tests/lang/bug26869.phpt b/tests/lang/bug26869.phpt
new file mode 100644
index 0000000..77dd259
--- /dev/null
+++ b/tests/lang/bug26869.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #26869 (constant as the key of static array)
+--FILE--
+<?php
+ define("A", "1");
+ static $a=array(A => 1);
+ var_dump($a);
+ var_dump(isset($a[A]));
+?>
+--EXPECT--
+array(1) {
+ [1]=>
+ int(1)
+}
+bool(true)
diff --git a/tests/lang/bug27354.phpt b/tests/lang/bug27354.phpt
new file mode 100644
index 0000000..e10ad9c
--- /dev/null
+++ b/tests/lang/bug27354.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #27354 (Modulus operator crashes PHP)
+--FILE--
+<?php
+ var_dump(-2147483647 % -1);
+ var_dump(-2147483649 % -1);
+ var_dump(-2147483648 % -1);
+ var_dump(-2147483648 % -2);
+?>
+--EXPECTF--
+int(%i)
+int(%i)
+int(%i)
+int(%i)
diff --git a/tests/lang/bug27439.phpt b/tests/lang/bug27439.phpt
new file mode 100644
index 0000000..4bcadb7
--- /dev/null
+++ b/tests/lang/bug27439.phpt
@@ -0,0 +1,76 @@
+--TEST--
+Bug #27439 (foreach() with $this segfaults)
+--FILE--
+<?php
+
+class test_props {
+ public $a = 1;
+ public $b = 2;
+ public $c = 3;
+}
+
+class test {
+ public $array = array(1,2,3);
+ public $string = "string";
+
+ public function __construct() {
+ $this->object = new test_props;
+ }
+
+ public function getArray() {
+ return $this->array;
+ }
+
+ public function getString() {
+ return $this->string;
+ }
+
+ public function case1() {
+ foreach ($this->array as $foo) {
+ echo $foo;
+ }
+ }
+
+ public function case2() {
+ foreach ($this->foobar as $foo);
+ }
+
+ public function case3() {
+ foreach ($this->string as $foo);
+ }
+
+ public function case4() {
+ foreach ($this->getArray() as $foo);
+ }
+
+ public function case5() {
+ foreach ($this->getString() as $foo);
+ }
+
+ public function case6() {
+ foreach ($this->object as $foo) {
+ echo $foo;
+ }
+ }
+}
+$test = new test();
+$test->case1();
+$test->case2();
+$test->case3();
+$test->case4();
+$test->case5();
+$test->case6();
+echo "\n";
+echo "===DONE===";
+?>
+--EXPECTF--
+123
+Notice: Undefined property: test::$foobar in %s on line %d
+
+Warning: Invalid argument supplied for foreach() in %s on line %d
+
+Warning: Invalid argument supplied for foreach() in %s on line %d
+
+Warning: Invalid argument supplied for foreach() in %s on line %d
+123
+===DONE===
diff --git a/tests/lang/bug27443.phpt b/tests/lang/bug27443.phpt
new file mode 100644
index 0000000..4097943
--- /dev/null
+++ b/tests/lang/bug27443.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #27443 (defined() returns wrong type)
+--FILE--
+<?php
+echo gettype(defined('test'));
+?>
+--EXPECT--
+boolean
diff --git a/tests/lang/bug27535.phpt b/tests/lang/bug27535.phpt
new file mode 100644
index 0000000..a6ceae7
--- /dev/null
+++ b/tests/lang/bug27535.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Bug #27535 (Objects pointing to each other cause Apache to crash)
+--FILE--
+<?php
+
+class Class1
+{
+ public $_Class2_obj;
+}
+
+class Class2
+{
+ public $storage = '';
+
+ function Class2()
+ {
+ $this->storage = new Class1();
+
+ $this->storage->_Class2_obj = $this;
+ }
+}
+
+$foo = new Class2();
+
+?>
+Alive!
+--EXPECT--
+Alive!
diff --git a/tests/lang/bug28213.phpt b/tests/lang/bug28213.phpt
new file mode 100644
index 0000000..3677d4c
--- /dev/null
+++ b/tests/lang/bug28213.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #28213 (crash in debug_print_backtrace in static methods)
+--FILE--
+<?php
+class FooBar { static function error() { debug_print_backtrace(); } }
+set_error_handler(array('FooBar', 'error'));
+include('foobar.php');
+?>
+--EXPECTREGEX--
+.*#1\s*include.*
diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt
new file mode 100644
index 0000000..f81ad7f
--- /dev/null
+++ b/tests/lang/bug28800.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #28800 (Incorrect string to number conversion for strings starting with 'inf')
+--FILE--
+<?php
+ $strings = array('into', 'info', 'inf', 'infinity', 'infin', 'inflammable');
+ foreach ($strings as $v) {
+ echo ($v+0)."\n";
+ }
+?>
+--EXPECT--
+0
+0
+0
+0
+0
+0
+
diff --git a/tests/lang/bug29566.phpt b/tests/lang/bug29566.phpt
new file mode 100644
index 0000000..16aec8f
--- /dev/null
+++ b/tests/lang/bug29566.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #29566 (foreach/string handling strangeness)
+--FILE--
+<?php
+$var="This is a string";
+
+$dummy="";
+unset($dummy);
+
+foreach($var['nosuchkey'] as $v) {
+}
+?>
+===DONE===
+--EXPECTF--
+Warning: Illegal string offset 'nosuchkey' in %sbug29566.php on line %d
+
+Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d
+===DONE===
diff --git a/tests/lang/bug29893.phpt b/tests/lang/bug29893.phpt
new file mode 100644
index 0000000..d320de0
--- /dev/null
+++ b/tests/lang/bug29893.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #29893 (segfault when using array as index)
+--FILE--
+<?php
+$base = 50;
+$base[$base] -= 0;
+?>
+===DONE===
+--EXPECTF--
+Warning: Cannot use a scalar value as an array in %sbug29893.php on line %d
+===DONE===
diff --git a/tests/lang/bug29944.phpt b/tests/lang/bug29944.phpt
new file mode 100644
index 0000000..7882936
--- /dev/null
+++ b/tests/lang/bug29944.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #29944 (function defined in switch crashes PHP)
+--FILE--
+<?PHP
+$a = 1;
+$b = "1";
+switch ($a) {
+ case 1:
+ function foo($bar) {
+ if (preg_match('/\d/', $bar)) return true;
+ return false;
+ }
+ echo foo($b);
+}
+?>
+
+===DONE===
+--EXPECT--
+1
+===DONE===
diff --git a/tests/lang/bug30578.phpt b/tests/lang/bug30578.phpt
new file mode 100644
index 0000000..d8a8d2e
--- /dev/null
+++ b/tests/lang/bug30578.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Bug #30578 (Output buffers flushed before calling __desctruct functions)
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+class Example
+{
+ function __construct()
+ {
+ ob_start();
+ echo "This should be displayed last.\n";
+ }
+
+ function __destruct()
+ {
+ $buffered_data = ob_get_contents();
+ ob_end_clean();
+
+ echo "This should be displayed first.\n";
+ echo "Buffered data: $buffered_data";
+ }
+}
+
+$obj = new Example;
+
+?>
+--EXPECT--
+This should be displayed first.
+Buffered data: This should be displayed last.
diff --git a/tests/lang/bug30638.phpt b/tests/lang/bug30638.phpt
new file mode 100644
index 0000000..945a228
--- /dev/null
+++ b/tests/lang/bug30638.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X)
+--SKIPIF--
+<?php # try to activate a german locale
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ /* skip on windows until #63688 was fixed */
+ die('skip');
+}
+if (setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1") === FALSE) {
+ print "skip setlocale() failed";
+} elseif (strtolower(php_uname('s')) == 'darwin') {
+ print "skip ok to fail on MacOS X";
+}
+?>
+--FILE--
+<?php
+# activate the german locale
+setlocale(LC_NUMERIC, "de_DE.UTF-8", "de_DE", "de", "german", "ge", "de_DE.ISO-8859-1");
+
+$lc = localeconv();
+printf("decimal_point: %s\n", $lc['decimal_point']);
+printf("thousands_sep: %s\n", $lc['thousands_sep']);
+?>
+--EXPECT--
+decimal_point: ,
+thousands_sep: .
diff --git a/tests/lang/bug30726.phpt b/tests/lang/bug30726.phpt
new file mode 100644
index 0000000..79aeff7
--- /dev/null
+++ b/tests/lang/bug30726.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #30726 (-.1 like numbers are not being handled correctly)
+--FILE--
+<?php
+echo (int) is_float('-.1' * 2), "\n";
+?>
+--EXPECT--
+1
diff --git a/tests/lang/bug30862.phpt b/tests/lang/bug30862.phpt
new file mode 100644
index 0000000..12c95d5
--- /dev/null
+++ b/tests/lang/bug30862.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #30862 (Static array with boolean indexes)
+--FILE--
+<?php
+class T {
+ static $a = array(false=>"false", true=>"true");
+}
+print_r(T::$a);
+?>
+----------
+<?php
+define("X",0);
+define("Y",1);
+class T2 {
+ static $a = array(X=>"false", Y=>"true");
+}
+print_r(T2::$a);
+?>
+--EXPECT--
+Array
+(
+ [0] => false
+ [1] => true
+)
+----------
+Array
+(
+ [0] => false
+ [1] => true
+)
diff --git a/tests/lang/bug32828.phpt b/tests/lang/bug32828.phpt
new file mode 100644
index 0000000..ad59646
--- /dev/null
+++ b/tests/lang/bug32828.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #32828 (Throwing exception in output_callback function with ob_start and ob_end_clean leads to segfault)
+--FILE--
+<?php
+
+function output_handler($buffer)
+{
+ throw new Exception;
+}
+
+ob_start('output_handler');
+
+ob_end_clean();
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'Exception' in %s:%d
+Stack trace:
+#0 [internal function]: output_handler('', %d)
+#1 %s(%d): ob_end_clean()
+#2 {main}
+ thrown in %s on line %d
diff --git a/tests/lang/bug32924.phpt b/tests/lang/bug32924.phpt
new file mode 100644
index 0000000..d72b0ea
--- /dev/null
+++ b/tests/lang/bug32924.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #32924 (prepend does not add file to included files)
+--INI--
+include_path={PWD}
+auto_prepend_file=inc.inc
+--FILE--
+<?php
+include_once(dirname(__FILE__).'/inc.inc');
+require_once(dirname(__FILE__).'/inc.inc');
+?>
+END
+--EXPECT--
+Included!
+END
diff --git a/tests/lang/bug35176.phpt b/tests/lang/bug35176.phpt
new file mode 100644
index 0000000..2928f7e
--- /dev/null
+++ b/tests/lang/bug35176.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #35176 (include()/require()/*_once() produce wrong error messages about main())
+--INI--
+html_errors=1
+docref_root="/"
+error_reporting=4095
+--FILE--
+<?php
+require_once('nonexisiting.php');
+?>
+--EXPECTF--
+<br />
+<b>Warning</b>: require_once(nonexisiting.php) [<a href='/function.require-once.html'>function.require-once.html</a>]: failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br />
+<br />
+<b>Fatal error</b>: require_once() [<a href='/function.require.html'>function.require.html</a>]: Failed opening required 'nonexisiting.php' (%s) in <b>%sbug35176.php</b> on line <b>2</b><br />
diff --git a/tests/lang/bug35382.phpt b/tests/lang/bug35382.phpt
new file mode 100644
index 0000000..69190d4
--- /dev/null
+++ b/tests/lang/bug35382.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #35382 (Comment in end of file produces fatal error)
+--FILEEOF--
+<?php
+eval("echo 'Hello'; // comment");
+echo " World";
+//last line comment
+--EXPECTF--
+Hello World
diff --git a/tests/lang/bug38579.inc b/tests/lang/bug38579.inc
new file mode 100644
index 0000000..8ecc558
--- /dev/null
+++ b/tests/lang/bug38579.inc
@@ -0,0 +1,3 @@
+<?php
+echo "ok\n";
+?>
diff --git a/tests/lang/bug38579.phpt b/tests/lang/bug38579.phpt
new file mode 100644
index 0000000..445296c
--- /dev/null
+++ b/tests/lang/bug38579.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #38579 (include_once() may include the same file twice)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip only for Windows');
+}
+?>
+--FILE--
+<?php
+$file = dirname(__FILE__)."/bug38579.inc";
+include_once(strtolower($file));
+include_once(strtoupper($file));
+?>
+--EXPECT--
+ok
diff --git a/tests/lang/bug43958.phpt b/tests/lang/bug43958.phpt
new file mode 100644
index 0000000..bc88bcd
--- /dev/null
+++ b/tests/lang/bug43958.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #43958 (class name added into the error message)
+--FILE--
+<?php
+class MyClass
+{
+ static public function loadCode($p) {
+ return include $p;
+ }
+}
+
+MyClass::loadCode('file-which-does-not-exist-on-purpose.php');
+--EXPECTF--
+Warning: include(file-which-does-not-exist-on-purpose.php): failed to open stream: No such file or directory in %sbug43958.php on line 5
+
+Warning: include(): Failed opening 'file-which-does-not-exist-on-purpose.php' for inclusion (include_path='%s') in %sbug43958.php on line 5
+
diff --git a/tests/lang/bug44654.phpt b/tests/lang/bug44654.phpt
new file mode 100644
index 0000000..be714e8
--- /dev/null
+++ b/tests/lang/bug44654.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #44654 (syntax error for #)
+--FILE--
+#<?php echo 1; ?>
+<?php if (1) { ?>#<?php } ?>
+#<?php echo 1; ?>
+--EXPECT--
+#1##1
diff --git a/tests/lang/bug44827.phpt b/tests/lang/bug44827.phpt
new file mode 100644
index 0000000..031045b
--- /dev/null
+++ b/tests/lang/bug44827.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #44827 (Class error when trying to access :: as constant)
+--CREDITS--
+Sebastian SchÃŒrmann
+sebs@php.net
+Testfest Munich 2009
+--FILE--
+<?php
+define('::', true);
+var_dump(constant('::'));
+?>
+--EXPECTF--
+Warning: Class constants cannot be defined or redefined in %s on line %d
+
+Warning: constant(): Couldn't find constant :: in %s on line %d
+NULL
+
diff --git a/tests/lang/bug45392.phpt b/tests/lang/bug45392.phpt
new file mode 100644
index 0000000..78876c7
--- /dev/null
+++ b/tests/lang/bug45392.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #45392 (ob_start()/ob_end_clean() and memory_limit)
+--INI--
+display_errors=stderr
+--SKIPIF--
+<?php
+if (getenv("USE_ZEND_ALLOC") === "0") {
+ die("skip Zend MM disabled");
+}
+--FILE--
+<?php
+echo __LINE__ . "\n";
+ini_set('memory_limit', 100);
+ob_start();
+$i = 0;
+while($i++ < 5000) {
+ echo str_repeat("may not be displayed ", 42);
+}
+ob_end_clean();
+?>
+--EXPECTF--
+2
+Fatal error: Allowed memory size of %d bytes exhausted%s
diff --git a/tests/lang/bug55754.phpt b/tests/lang/bug55754.phpt
new file mode 100644
index 0000000..c58ec91
--- /dev/null
+++ b/tests/lang/bug55754.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #55754 (Only variables should be passed by reference for ZEND_SEND_PREFER_REF params)
+--FILE--
+<?php
+
+current($arr = array(0 => "a"));
+current(array(0 => "a"));
+current($arr);
+
+echo "DONE";
+
+?>
+--EXPECT--
+DONE
diff --git a/tests/lang/bug7515.phpt b/tests/lang/bug7515.phpt
new file mode 100644
index 0000000..ea58061
--- /dev/null
+++ b/tests/lang/bug7515.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #7515 (weird & invisible referencing of objects)
+--SKIPIF--
+<?php if(version_compare(zend_version(), "2.0.0-dev", '<')) echo "skip Zend Engine 2 needed\n"; ?>
+--INI--
+error_reporting=2039
+--FILE--
+<?php
+class obj {
+ function method() {}
+}
+
+$o->root=new obj();
+
+ob_start();
+var_dump($o);
+$x=ob_get_contents();
+ob_end_clean();
+
+$o->root->method();
+
+ob_start();
+var_dump($o);
+$y=ob_get_contents();
+ob_end_clean();
+if ($x == $y) {
+ print "success";
+} else {
+ print "failure
+x=$x
+y=$y
+";
+}
+?>
+--EXPECTF--
+Warning: Creating default object from empty value in %s on line %d
+success
diff --git a/tests/lang/catchable_error_001.phpt b/tests/lang/catchable_error_001.phpt
new file mode 100644
index 0000000..f6bbdd9
--- /dev/null
+++ b/tests/lang/catchable_error_001.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Catchable fatal error [1]
+--FILE--
+<?php
+ class Foo {
+ }
+
+ function blah (Foo $a)
+ {
+ }
+
+ function error()
+ {
+ $a = func_get_args();
+ var_dump($a);
+ }
+
+ blah (new StdClass);
+ echo "ALIVE!\n";
+?>
+--EXPECTF--
+Catchable fatal error: Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_001.php on line 15 and defined in %scatchable_error_001.php on line 5
diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt
new file mode 100644
index 0000000..c1762b2
--- /dev/null
+++ b/tests/lang/catchable_error_002.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Catchable fatal error [2]
+--FILE--
+<?php
+ class Foo {
+ }
+
+ function blah (Foo $a)
+ {
+ }
+
+ function error()
+ {
+ $a = func_get_args();
+ var_dump($a);
+ }
+
+ set_error_handler('error');
+
+ blah (new StdClass);
+ echo "ALIVE!\n";
+?>
+--EXPECTF--
+array(5) {
+ [0]=>
+ int(4096)
+ [1]=>
+ string(%d) "Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined"
+ [2]=>
+ string(%d) "%scatchable_error_002.php"
+ [3]=>
+ int(5)
+ [4]=>
+ array(0) {
+ }
+}
+ALIVE!
diff --git a/tests/lang/comments.phpt b/tests/lang/comments.phpt
new file mode 100644
index 0000000..ca8b1d2
--- /dev/null
+++ b/tests/lang/comments.phpt
@@ -0,0 +1,24 @@
+--TEST--
+#-style comments
+--FILE--
+#teste
+#teste2
+<?php
+
+#ahahah
+#ahhfhf
+
+echo '#ola'; //?
+echo "\n";
+echo 'uhm # ah'; #ah?
+echo "\n";
+echo "e este, # hein?";
+echo "\n";
+
+?>
+--EXPECT--
+#teste
+#teste2
+#ola
+uhm # ah
+e este, # hein?
diff --git a/tests/lang/comments2.phpt b/tests/lang/comments2.phpt
new file mode 100644
index 0000000..8d727d9
--- /dev/null
+++ b/tests/lang/comments2.phpt
@@ -0,0 +1,9 @@
+--TEST--
+#-style comments (part 2)
+--FILEEOF--
+<?php
+if (1) {
+?>
+#<?php }
+--EXPECT--
+#
diff --git a/tests/lang/compare_objects_basic1.phpt b/tests/lang/compare_objects_basic1.phpt
new file mode 100644
index 0000000..fe312fc
--- /dev/null
+++ b/tests/lang/compare_objects_basic1.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Test standard 'compare' object handler
+--FILE--
+
+<?php
+
+echo "Simple test for standard compare object handler\n";
+
+class class1{}
+
+class class2{}
+
+class class3{
+ public $aaa;
+ private $bbb;
+ protected $ccc;
+}
+
+class class4 extends class3{
+}
+
+class class5 extends class3{
+ public $ddd;
+ private $eee;
+}
+
+// Define a bunch of objects all of which will use standard compare object handler
+$obj1 = new class1();
+$obj2 = new class2();
+$obj3 = new class3();
+$obj4 = new class4();
+$obj5 = new class5();
+
+echo "\n-- The following compare should return TRUE --\n";
+var_dump($obj1 == $obj1);
+
+echo "\n-- All the following compares should return FALSE --\n";
+var_dump($obj1 == $obj2);
+var_dump($obj1 == $obj3);
+var_dump($obj1 == $obj4);
+var_dump($obj1 == $obj5);
+var_dump($obj4 == $obj3);
+var_dump($obj5 == $obj3);
+
+?>
+===DONE===
+--EXPECT--
+Simple test for standard compare object handler
+
+-- The following compare should return TRUE --
+bool(true)
+
+-- All the following compares should return FALSE --
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/compare_objects_basic2.phpt b/tests/lang/compare_objects_basic2.phpt
new file mode 100644
index 0000000..7e4786c
--- /dev/null
+++ b/tests/lang/compare_objects_basic2.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Test object compare when object handler different
+--FILE--
+
+<?php
+
+//Set the default time zone
+date_default_timezone_set("Europe/London");
+
+echo "Simple test comparing two objects with different compare callback handler\n";
+
+class X {
+}
+
+$obj1 = new X();
+$obj2 = new DateTime(("2009-02-12 12:47:41 GMT"));
+
+var_dump($obj1 == $obj2);
+?>
+===DONE===
+--EXPECTF--
+Simple test comparing two objects with different compare callback handler
+bool(false)
+===DONE===
diff --git a/tests/lang/each_binary_safety.phpt b/tests/lang/each_binary_safety.phpt
new file mode 100644
index 0000000..bb13534
--- /dev/null
+++ b/tests/lang/each_binary_safety.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Binary safety of each() for both keys and values
+--FILE--
+<?php
+error_reporting(E_ALL);
+$arr = array ("foo\0bar" => "foo\0bar");
+while (list($key, $val) = each($arr)) {
+ echo strlen($key), ': ';
+ echo urlencode($key), ' => ', urlencode($val), "\n";
+}
+?>
+--EXPECT--
+7: foo%00bar => foo%00bar
diff --git a/tests/lang/empty_variation.phpt b/tests/lang/empty_variation.phpt
new file mode 100644
index 0000000..8e940da
--- /dev/null
+++ b/tests/lang/empty_variation.phpt
@@ -0,0 +1,14 @@
+--TEST--
+empty() on array elements
+--FILE--
+<?php
+$a=array('0','empty'=>'0');
+var_dump(empty($a['empty']));
+var_dump(empty($a[0]));
+$b='0';
+var_dump(empty($b));
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
diff --git a/tests/lang/engine_assignExecutionOrder_001.phpt b/tests/lang/engine_assignExecutionOrder_001.phpt
new file mode 100644
index 0000000..1b85cb7
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_001.phpt
@@ -0,0 +1,152 @@
+--TEST--
+Evaluation order during assignments.
+--FILE--
+<?php
+
+function f() {
+ echo "in f()\n";
+ return "name";
+}
+
+function g() {
+ echo "in g()\n";
+ return "assigned value";
+}
+
+
+echo "\n\nOrder with local assignment:\n";
+${f()} = g();
+var_dump($name);
+
+echo "\n\nOrder with array assignment:\n";
+$a[f()] = g();
+var_dump($a);
+
+echo "\n\nOrder with object property assignment:\n";
+$oa = new stdClass;
+$oa->${f()} = g();
+var_dump($oa);
+
+echo "\n\nOrder with nested object property assignment:\n";
+$ob = new stdClass;
+$ob->o1 = new stdClass;
+$ob->o1->o2 = new stdClass;
+$ob->o1->o2->${f()} = g();
+var_dump($ob);
+
+echo "\n\nOrder with dim_list property assignment:\n";
+$oc = new stdClass;
+$oc->a[${f()}] = g();
+var_dump($oc);
+
+
+class C {
+ public static $name = "original";
+ public static $a = array();
+ public static $string = "hello";
+}
+echo "\n\nOrder with static property assignment:\n";
+C::${f()} = g();
+var_dump(C::$name);
+
+echo "\n\nOrder with static array property assignment:\n";
+C::$a[f()] = g();
+var_dump(C::$a);
+
+echo "\n\nOrder with indexed string assignment:\n";
+$string = "hello";
+function getOffset() {
+ echo "in getOffset()\n";
+ return 0;
+}
+function newChar() {
+ echo "in newChar()\n";
+ return 'j';
+}
+$string[getOffset()] = newChar();
+var_dump($string);
+
+echo "\n\nOrder with static string property assignment:\n";
+C::$string[getOffset()] = newChar();
+var_dump(C::$string);
+
+?>
+--EXPECTF--
+
+
+Order with local assignment:
+in f()
+in g()
+%string|unicode%(14) "assigned value"
+
+
+Order with array assignment:
+in f()
+in g()
+array(1) {
+ [%u|b%"name"]=>
+ %string|unicode%(14) "assigned value"
+}
+
+
+Order with object property assignment:
+in f()
+in g()
+object(stdClass)#%d (1) {
+ [%u|b%"assigned value"]=>
+ %string|unicode%(14) "assigned value"
+}
+
+
+Order with nested object property assignment:
+in f()
+in g()
+object(stdClass)#%d (1) {
+ [%u|b%"o1"]=>
+ object(stdClass)#%d (1) {
+ [%u|b%"o2"]=>
+ object(stdClass)#%d (1) {
+ [%u|b%"assigned value"]=>
+ %string|unicode%(14) "assigned value"
+ }
+ }
+}
+
+
+Order with dim_list property assignment:
+in f()
+in g()
+object(stdClass)#%d (1) {
+ [%u|b%"a"]=>
+ array(1) {
+ [%u|b%"assigned value"]=>
+ %string|unicode%(14) "assigned value"
+ }
+}
+
+
+Order with static property assignment:
+in f()
+in g()
+%string|unicode%(14) "assigned value"
+
+
+Order with static array property assignment:
+in f()
+in g()
+array(1) {
+ [%u|b%"name"]=>
+ %string|unicode%(14) "assigned value"
+}
+
+
+Order with indexed string assignment:
+in getOffset()
+in newChar()
+%string|unicode%(5) "jello"
+
+
+Order with static string property assignment:
+in getOffset()
+in newChar()
+%string|unicode%(5) "jello"
diff --git a/tests/lang/engine_assignExecutionOrder_002.phpt b/tests/lang/engine_assignExecutionOrder_002.phpt
new file mode 100644
index 0000000..ba88150
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_002.phpt
@@ -0,0 +1,135 @@
+--TEST--
+Evaluation order during assignments.
+--FILE--
+<?php
+
+// simple case with missing element
+$f = array("hello","item2","bye");
+list($a,,$b) = $f;
+echo "A=$a B=$b\n";
+
+
+// Warning: Cannot use a scalar value as an array in %s on line %d
+$c[$c=1] = 1;
+
+// i++ evaluated first, so $d[0] is 10
+$d = array(0,10);
+$i = 0;
+$d[$i++] = $i*10;
+// expected array is 10,10
+var_dump($d);
+
+// the f++++ makes f into 2, so $e 0 and 1 should both be 30
+$e = array(0,0);
+$f = 0;
+$g1 = array(10,10);
+$g2 = array(20,20);
+$g3 = array(30,30);
+$g = array($g1,$g2,$g3);
+list($e[$f++],$e[$f++]) = $g[$f];
+// expect 30,30
+var_dump($e);
+
+
+$i1 = array(1,2);
+$i2 = array(10,20);
+$i3 = array(100,200);
+$i4 = array(array(1000,2000),3000);
+$i = array($i1,$i2,$i3,$i4);
+$j = array(0,0,0);
+$h = 0;
+// a list of lists
+list(list($j[$h++],$j[$h++]),$j[$h++]) = $i[$h];
+var_dump($j);
+
+
+// list of lists with just variable assignments - expect 100,200,300
+$k3 = array(100,200);
+$k = array($k3,300);
+list(list($l,$m),$n) = $k;
+echo "L=$l M=$m N=$n\n";
+
+
+// expect $x and $y to be null - this fails on php.net 5.2.1 (invalid opcode) - fixed in 5.2.3
+list($o,$p) = 20;
+echo "O=$o and P=$p\n";
+
+
+// list of lists with blanks and nulls expect 10 20 40 50 60 70 80
+$q1 = array(10,20,30,40);
+$q2 = array(50,60);
+$q3 = array($q1,$q2,null,70);
+$q4 = array($q3,null,80);
+
+list(list(list($r,$s,,$t),list($u,$v),,$w),,$x) = $q4;
+echo "$r $s $t $u $v $w $x\n";
+
+
+// expect y and z to be undefined
+list($y,$z) = array();
+echo "Y=$y,Z=$z\n";
+
+// expect h to be defined and be 10
+list($aa,$bb) = array(10);
+echo "AA=$aa\n";
+
+// expect cc and dd to be 10 and 30
+list($cc,,$dd) = array(10,20,30,40);
+echo "CC=$cc DD=$dd\n";
+
+// expect the inner array to be defined
+$ee = array("original array");
+function f() {
+ global $ee;
+ $ee = array("array created in f()");
+ return 1;
+}
+$ee["array entry created after f()"][f()] = "hello";
+print_r($ee);
+
+?>
+--EXPECTF--
+A=hello B=bye
+
+Warning: Cannot use a scalar value as an array in %s on line %d
+array(2) {
+ [0]=>
+ int(10)
+ [1]=>
+ int(10)
+}
+array(2) {
+ [0]=>
+ int(30)
+ [1]=>
+ int(30)
+}
+array(3) {
+ [0]=>
+ int(1000)
+ [1]=>
+ int(2000)
+ [2]=>
+ int(3000)
+}
+L=100 M=200 N=300
+O= and P=
+10 20 40 50 60 70 80
+
+Notice: Undefined offset: 1 in %s on line %d
+
+Notice: Undefined offset: 0 in %s on line %d
+Y=,Z=
+
+Notice: Undefined offset: 1 in %s on line %d
+AA=10
+CC=10 DD=30
+Array
+(
+ [0] => array created in f()
+ [array entry created after f()] => Array
+ (
+ [1] => hello
+ )
+
+)
diff --git a/tests/lang/engine_assignExecutionOrder_003.phpt b/tests/lang/engine_assignExecutionOrder_003.phpt
new file mode 100644
index 0000000..ae3ae78
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_003.phpt
@@ -0,0 +1,96 @@
+--TEST--
+Evaluation order during assignments.
+--FILE--
+<?php
+$b = "bb";
+$a = "aa";
+
+function foo()
+{
+echo "Bad call\n";
+}
+
+function baa()
+{
+echo "Good call\n";
+}
+
+$bb = "baa";
+
+$aa = "foo";
+
+$c = ${$a=$b};
+
+$c();
+
+$a1 = array("dead","dead","dead");
+$a2 = array("dead","dead","live");
+$a3 = array("dead","dead","dead");
+
+$a = array($a1,$a2,$a3);
+
+function live()
+{
+echo "Good call\n";
+}
+
+function dead()
+{
+echo "Bad call\n";
+}
+
+$i = 0;
+
+$a[$i=1][++$i]();
+
+$a = -1;
+
+function foo1()
+{
+ global $a;
+ return ++$a;
+}
+
+$arr = array(array(0,0),0);
+
+$brr = array(0,0,array(0,0,0,5),0);
+$crr = array(0,0,0,0,array(0,0,0,0,0,10),0,0);
+
+$arr[foo1()][foo1()] = $brr[foo1()][foo1()] +
+ $crr[foo1()][foo1()];
+
+$val = $arr[0][1];
+echo "Expect 15 and get...$val\n";
+
+$x = array(array(0),0);
+function mod($b)
+{
+global $x;
+$x = $b;
+return 0;
+}
+
+$x1 = array(array(1),1);
+$x2 = array(array(2),2);
+$x3 = array(array(3),3);
+$bx = array(10);
+
+$x[mod($x1)][mod($x2)] = $bx[mod($x3)];
+
+// expecting 10,3
+
+var_dump($x);
+?>
+--EXPECT--
+Good call
+Good call
+Expect 15 and get...15
+array(2) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(10)
+ }
+ [1]=>
+ int(3)
+} \ No newline at end of file
diff --git a/tests/lang/engine_assignExecutionOrder_004.phpt b/tests/lang/engine_assignExecutionOrder_004.phpt
new file mode 100644
index 0000000..86bc87f
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_004.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Evaluation order during assignments.
+--FILE--
+<?php
+
+function i1() {
+ echo "i1\n";
+ return 1;
+}
+
+function i2() {
+ echo "i2\n";
+ return 1;
+}
+
+function i3() {
+ echo "i3\n";
+ return 3;
+}
+
+function i4() {
+ global $a;
+ $a = array(10, 11, 12, 13, 14);
+ echo "i4\n";
+ return 4;
+}
+
+$a = 0; // $a should not be indexable till the i4 has been executed
+list($a[i1()+i2()], , list($a[i3()], $a[i4()]), $a[]) = array (0, 1, array(30, 40), 3, 4);
+
+var_dump($a);
+
+?>
+--EXPECT--
+i1
+i2
+i3
+i4
+array(6) {
+ [0]=>
+ int(10)
+ [1]=>
+ int(11)
+ [2]=>
+ int(0)
+ [3]=>
+ int(30)
+ [4]=>
+ int(40)
+ [5]=>
+ int(3)
+}
diff --git a/tests/lang/engine_assignExecutionOrder_005.phpt b/tests/lang/engine_assignExecutionOrder_005.phpt
new file mode 100644
index 0000000..6ec03f1
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_005.phpt
@@ -0,0 +1,74 @@
+--TEST--
+Evaluation order during assignments.
+--FILE--
+<?php
+
+function i1() {
+ echo "i1\n";
+ return 0;
+}
+
+function i2() {
+ echo "i2\n";
+ return 0;
+}
+
+function i3() {
+ echo "i3\n";
+ return 0;
+}
+
+function i4() {
+ echo "i4\n";
+ return 0;
+}
+
+function i5() {
+ echo "i5\n";
+ return 0;
+}
+
+function i6() {
+ echo "i6\n";
+ return 0;
+}
+
+$a = array(array(0));
+$b = array(array(1));
+$c = array(array(2));
+
+$a[i1()][i2()] = $b[i3()][i4()] = $c[i5()][i6()];
+
+var_dump($a);
+var_dump($b);
+var_dump($c);
+
+?>
+--EXPECT--
+i1
+i2
+i3
+i4
+i5
+i6
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
diff --git a/tests/lang/engine_assignExecutionOrder_006.phpt b/tests/lang/engine_assignExecutionOrder_006.phpt
new file mode 100644
index 0000000..faa34c3
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_006.phpt
@@ -0,0 +1,138 @@
+--TEST--
+Evaluation order during assignments.
+--FILE--
+<?php
+
+function i1() {
+ echo "i1\n";
+ return 0;
+}
+
+function i2() {
+ echo "i2\n";
+ return 0;
+}
+
+function i3() {
+ echo "i3\n";
+ return 0;
+}
+
+function i4() {
+ echo "i4\n";
+ return 0;
+}
+
+function i5() {
+ echo "i5\n";
+ return 0;
+}
+
+function i6() {
+ echo "i6\n";
+ return 0;
+}
+
+$a = array(array(0));
+$b = array(array(1));
+$c = array(array(2));
+
+$a[i1()][i2()] = ($b[i3()][i4()] = $c[i5()][i6()]);
+var_dump($a);
+var_dump($b);
+var_dump($c);
+
+$a[i1()][i2()] = $b[i3()][i4()] = -$c[i5()][i6()];
+var_dump($a);
+var_dump($b);
+var_dump($c);
+
+$a[i1()][i2()] = -($b[i3()][i4()] = +($c[i5()][i6()]));
+var_dump($a);
+var_dump($b);
+var_dump($c);
+
+
+?>
+--EXPECT--
+i1
+i2
+i3
+i4
+i5
+i6
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+i1
+i2
+i3
+i4
+i5
+i6
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(-2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(-2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+i1
+i2
+i3
+i4
+i5
+i6
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(-2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ int(2)
+ }
+}
diff --git a/tests/lang/engine_assignExecutionOrder_007.phpt b/tests/lang/engine_assignExecutionOrder_007.phpt
new file mode 100644
index 0000000..56b729e
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_007.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Check key execution order with &new.
+--FILE--
+<?php
+$a[2][3] = 'stdClass';
+$a[$i=0][++$i] =& new $a[++$i][++$i];
+print_r($a);
+
+$o = new stdClass;
+$o->a =& new $a[$i=2][++$i];
+$o->a->b =& new $a[$i=2][++$i];
+print_r($o);
+?>
+--EXPECTF--
+Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 3
+
+Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 7
+
+Deprecated: Assigning the return value of new by reference is deprecated in %s.php on line 8
+Array
+(
+ [2] => Array
+ (
+ [3] => stdClass
+ )
+
+ [0] => Array
+ (
+ [1] => stdClass Object
+ (
+ )
+
+ )
+
+)
+stdClass Object
+(
+ [a] => stdClass Object
+ (
+ [b] => stdClass Object
+ (
+ )
+
+ )
+
+)
diff --git a/tests/lang/engine_assignExecutionOrder_008.phpt b/tests/lang/engine_assignExecutionOrder_008.phpt
new file mode 100644
index 0000000..1333bcd
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_008.phpt
@@ -0,0 +1,81 @@
+--TEST--
+Ensure by value assignments leave temporaries on the stack, for all sorts of assignees.
+--FILE--
+<?php
+error_reporting(E_ALL & ~E_STRICT);
+
+function f() { return 0; }
+$a[0][1] = 'good';
+$a[1][1] = 'bad';
+
+echo "\n" . '$i=f(): ';
+echo $a[$i=f()][++$i];
+unset($i);
+
+echo "\n" . '$$x=f(): ';
+$x='i';
+echo $a[$$x=f()][++$$x];
+unset($i, $x);
+
+echo "\n" . '${\'i\'}=f(): ';
+echo $a[${'i'}=f()][++${'i'}];
+unset(${'i'});
+
+echo "\n" . '$i[0]=f(): ';
+echo $a[$i[0]=f()][++$i[0]];
+unset($i);
+
+echo "\n" . '$i[0][0]=f(): ';
+echo $a[$i[0][0]=f()][++$i[0][0]];
+unset($i);
+
+echo "\n" . '$i->p=f(): ';
+echo $a[$i->p=f()][++$i->p];
+unset($i);
+
+echo "\n" . '$i->p->q=f(): ';
+echo $a[$i->p->q=f()][++$i->p->q];
+unset($i);
+
+echo "\n" . '$i->p[0]=f(): ';
+echo $a[$i->p[0]=f()][++$i->p[0]];
+unset($i);
+
+echo "\n" . '$i->p[0]->p=f(): ';
+echo $a[$i->p[0]->p=f()][++$i->p[0]->p];
+unset($i);
+
+Class C {
+ static $p;
+}
+
+echo "\n" . 'C::$p=f(): ';
+echo $a[C::$p=f()][++C::$p];
+
+echo "\n" . 'C::$p[0]=f(): ';
+C::$p = array();
+echo $a[C::$p[0]=f()][++C::$p[0]];
+
+echo "\n" . 'C::$p->q=f(): ';
+C::$p = new stdclass;
+echo $a[C::$p->q=f()][++C::$p->q];
+?>
+--EXPECTF--
+$i=f(): good
+$$x=f(): good
+${'i'}=f(): good
+$i[0]=f(): good
+$i[0][0]=f(): good
+$i->p=f():
+Warning: Creating default object from empty value in %s on line %d
+good
+$i->p->q=f():
+Warning: Creating default object from empty value in %s on line %d
+good
+$i->p[0]=f(): good
+$i->p[0]->p=f():
+Warning: Creating default object from empty value in %s on line %d
+good
+C::$p=f(): good
+C::$p[0]=f(): good
+C::$p->q=f(): good
diff --git a/tests/lang/engine_assignExecutionOrder_009.phpt b/tests/lang/engine_assignExecutionOrder_009.phpt
new file mode 100644
index 0000000..e1d5b71
--- /dev/null
+++ b/tests/lang/engine_assignExecutionOrder_009.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Execution ordering with comparison operators.
+--FILE--
+<?php
+function f($x) {
+ echo "f($x) ";
+ return $x;
+}
+
+echo "Function call args:\n";
+var_dump(f($i=0) < f(++$i));
+var_dump(f($i=0) <= f(++$i));
+var_dump(f($i=0) > f(++$i));
+var_dump(f($i=0) >= f(++$i));
+
+echo "\nArray indices:\n";
+$a[1][2] = 0;
+$a[3][4] = 1;
+$i=0;
+var_dump($a[$i=1][++$i] < $a[++$i][++$i]);
+var_dump($a[$i=1][++$i] <= $a[++$i][++$i]);
+var_dump($a[$i=1][++$i] > $a[++$i][++$i]);
+var_dump($a[$i=1][++$i] >= $a[++$i][++$i]);
+?>
+--EXPECTF--
+Function call args:
+f(0) f(1) bool(true)
+f(0) f(1) bool(true)
+f(0) f(1) bool(false)
+f(0) f(1) bool(false)
+
+Array indices:
+bool(true)
+bool(true)
+bool(false)
+bool(false)
diff --git a/tests/lang/error_2_exception_001.phpt b/tests/lang/error_2_exception_001.phpt
new file mode 100644
index 0000000..61f45d4
--- /dev/null
+++ b/tests/lang/error_2_exception_001.phpt
@@ -0,0 +1,45 @@
+--TEST--
+ZE2 errors caught as exceptions
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class MyException extends Exception {
+ function MyException($_errno, $_errmsg) {
+ $this->errno = $_errno;
+ $this->errmsg = $_errmsg;
+ }
+
+ function getErrno() {
+ return $this->errno;
+ }
+
+ function getErrmsg() {
+ return $this->errmsg;
+ }
+}
+
+function ErrorsToExceptions($errno, $errmsg) {
+ throw new MyException($errno, $errmsg);
+}
+
+set_error_handler("ErrorsToExceptions");
+
+// make sure it isn't catching exceptions that weren't
+// thrown...
+
+try {
+} catch (MyException $exception) {
+ echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n";
+}
+
+try {
+ trigger_error("I will become an exception", E_USER_ERROR);
+} catch (MyException $exception) {
+ echo "There was an exception: " . $exception->getErrno() . ", '" . $exception->getErrmsg() . "'\n";
+}
+
+?>
+--EXPECT--
+There was an exception: 256, 'I will become an exception'
diff --git a/tests/lang/execution_order.phpt b/tests/lang/execution_order.phpt
new file mode 100644
index 0000000..ca3feb3
--- /dev/null
+++ b/tests/lang/execution_order.phpt
@@ -0,0 +1,198 @@
+--TEST--
+Execution order of variables
+--FILE--
+<?php
+
+/* strings and concat */
+
+class strclass {
+ var $str = "bad";
+ static $statstr = "bad";
+}
+
+$a = "bad";
+$b = "good";
+echo "1)";
+$c = $a.($a=$b);
+echo $c;
+echo "\r\n";
+
+$a = "bad";
+$b = "good";
+$c = ($a=$b).$a;
+echo "2)";
+echo $c;
+echo "\r\n";
+
+
+$str = new strclass();
+$c = $str->str.($str->str="good");
+echo "3)";
+echo $c;
+echo "\r\n";
+
+$str->str = "bad";
+
+$c = ($str->str="good").$str->str;
+echo "4)";
+echo $c;
+echo "\r\n";
+
+$c = strclass::$statstr.(strclass::$statstr="good");
+echo "5)";
+echo $c;
+echo "\r\n";
+
+strclass::$statstr = "bad";
+
+$c = (strclass::$statstr="good").strclass::$statstr;
+echo "6)";
+echo $c;
+echo "\r\n";
+
+
+function foo() {
+ global $a;
+ $a = "good";
+ return $a;
+}
+
+
+$a = "bad";
+echo "7)";
+echo foo() . $a;
+echo "\r\n";
+
+$a = "bad";
+echo "8)";
+echo $a . foo();
+echo "\r\n";
+
+/* other operators */
+
+$x = 1;
+$z = $x - ($x++);
+echo "9)";
+echo $z;
+echo "\r\n";
+
+$x = 1;
+$z = ($x++) - $x;
+echo "10)";
+echo $z;
+echo "\r\n";
+
+$x = 1;
+$z = $x - (++$x);
+echo "11)";
+echo $z;
+echo "\r\n";
+
+$x = 1;
+$z = (++$x) - $x;
+echo "12)";
+echo $z;
+echo "\r\n";
+
+
+$x = 1;
+$y = 3;
+$z = $x - ($x=$y);
+echo "13)";
+echo $z;
+echo "\r\n";
+
+$x = 1;
+$y = 3;
+$z = ($x=$y) - $x;
+echo "14)";
+echo $z;
+echo "\r\n";
+
+
+$a = 100;
+$b = 200;
+echo "15)";
+echo $a + ($a=$b);
+echo "\r\n";
+
+$a = 100;
+$b = 200;
+echo "16)";
+echo ($a=$b) + $a;
+echo "\r\n";
+
+
+$a = array(100,200);
+$i = 0;
+
+echo "17)";
+echo $a[$i++] + $a[$i++];
+echo "\r\n";
+
+$i = -1;
+echo "18)";
+echo $a[++$i] + $a[++$i];
+echo "\r\n";
+
+$i = 0;
+echo "19)";
+echo $a[$i] + ($a[$i]=400);
+echo "\r\n";
+
+
+$a[0] = 100;
+echo "20)";
+echo ($a[$i]=400) + $a[$i];
+echo "\r\n";
+
+
+class c {
+ var $val = 10;
+ static $stat = 20;
+}
+
+echo "21)";
+echo c::$stat + (c::$stat=200);
+echo "\r\n";
+
+echo "22)";
+echo (c::$stat=300) + c::$stat;
+echo "\r\n";
+
+$c = new c();
+
+echo "23)";
+echo $c->val + ($c->val=200);
+echo "\r\n";
+
+echo "24)";
+echo ($c->val=300) + $c->val;
+echo "\r\n";
+
+?>
+--EXPECT--
+1)goodgood
+2)goodgood
+3)badgood
+4)goodgood
+5)badgood
+6)goodgood
+7)goodgood
+8)goodgood
+9)1
+10)-1
+11)0
+12)0
+13)0
+14)0
+15)400
+16)400
+17)300
+18)300
+19)500
+20)800
+21)220
+22)600
+23)210
+24)600
diff --git a/tests/lang/foreachLoop.001.phpt b/tests/lang/foreachLoop.001.phpt
new file mode 100644
index 0000000..164cac6
--- /dev/null
+++ b/tests/lang/foreachLoop.001.phpt
@@ -0,0 +1,64 @@
+--TEST--
+Foreach loop tests - basic loop with just value and key => value.
+--FILE--
+<?php
+
+$a = array("a","b","c");
+
+foreach ($a as $v) {
+ var_dump($v);
+}
+foreach ($a as $k => $v) {
+ var_dump($k, $v);
+}
+//check key and value after the loop.
+var_dump($k, $v);
+
+echo "\n";
+//Dynamic array
+foreach (array("d","e","f") as $v) {
+ var_dump($v);
+}
+foreach (array("d","e","f") as $k => $v) {
+ var_dump($k, $v);
+}
+//check key and value after the loop.
+var_dump($k, $v);
+
+echo "\n";
+//Ensure counter is advanced during loop
+$a=array("a","b","c");
+foreach ($a as $v);
+var_dump(current($a));
+$a=array("a","b","c");
+foreach ($a as &$v);
+var_dump(current($a));
+
+?>
+--EXPECT--
+string(1) "a"
+string(1) "b"
+string(1) "c"
+int(0)
+string(1) "a"
+int(1)
+string(1) "b"
+int(2)
+string(1) "c"
+int(2)
+string(1) "c"
+
+string(1) "d"
+string(1) "e"
+string(1) "f"
+int(0)
+string(1) "d"
+int(1)
+string(1) "e"
+int(2)
+string(1) "f"
+int(2)
+string(1) "f"
+
+bool(false)
+bool(false) \ No newline at end of file
diff --git a/tests/lang/foreachLoop.002.phpt b/tests/lang/foreachLoop.002.phpt
new file mode 100644
index 0000000..e3000c7
--- /dev/null
+++ b/tests/lang/foreachLoop.002.phpt
@@ -0,0 +1,173 @@
+--TEST--
+Foreach loop tests - modifying the array during the loop.
+--FILE--
+<?php
+
+echo "\nDirectly changing array values.\n";
+$a = array("original.1","original.2","original.3");
+foreach ($a as $k=>$v) {
+ $a[$k]="changed.$k";
+ var_dump($v);
+}
+var_dump($a);
+
+echo "\nModifying the foreach \$value.\n";
+$a = array("original.1","original.2","original.3");
+foreach ($a as $k=>$v) {
+ $v="changed.$k";
+}
+var_dump($a);
+
+
+echo "\nModifying the foreach &\$value.\n";
+$a = array("original.1","original.2","original.3");
+foreach ($a as $k=>&$v) {
+ $v="changed.$k";
+}
+var_dump($a);
+
+echo "\nPushing elements onto an unreferenced array.\n";
+$a = array("original.1","original.2","original.3");
+$counter=0;
+foreach ($a as $v) {
+ array_push($a, "new.$counter");
+
+ //avoid infinite loop if test is failing
+ if ($counter++>10) {
+ echo "Loop detected\n";
+ break;
+ }
+}
+var_dump($a);
+
+echo "\nPushing elements onto an unreferenced array, using &\$value.\n";
+$a = array("original.1","original.2","original.3");
+$counter=0;
+foreach ($a as &$v) {
+ array_push($a, "new.$counter");
+
+ //avoid infinite loop if test is failing
+ if ($counter++>10) {
+ echo "Loop detected\n";
+ break;
+ }
+}
+var_dump($a);
+
+echo "\nPopping elements off an unreferenced array.\n";
+$a = array("original.1","original.2","original.3");
+foreach ($a as $v) {
+ array_pop($a);
+ var_dump($v);
+}
+var_dump($a);
+
+echo "\nPopping elements off an unreferenced array, using &\$value.\n";
+$a = array("original.1","original.2","original.3");
+foreach ($a as &$v) {
+ array_pop($a);
+ var_dump($v);
+}
+var_dump($a);
+
+?>
+--EXPECT--
+
+Directly changing array values.
+string(10) "original.1"
+string(10) "original.2"
+string(10) "original.3"
+array(3) {
+ [0]=>
+ string(9) "changed.0"
+ [1]=>
+ string(9) "changed.1"
+ [2]=>
+ string(9) "changed.2"
+}
+
+Modifying the foreach $value.
+array(3) {
+ [0]=>
+ string(10) "original.1"
+ [1]=>
+ string(10) "original.2"
+ [2]=>
+ string(10) "original.3"
+}
+
+Modifying the foreach &$value.
+array(3) {
+ [0]=>
+ string(9) "changed.0"
+ [1]=>
+ string(9) "changed.1"
+ [2]=>
+ &string(9) "changed.2"
+}
+
+Pushing elements onto an unreferenced array.
+array(6) {
+ [0]=>
+ string(10) "original.1"
+ [1]=>
+ string(10) "original.2"
+ [2]=>
+ string(10) "original.3"
+ [3]=>
+ string(5) "new.0"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.2"
+}
+
+Pushing elements onto an unreferenced array, using &$value.
+Loop detected
+array(15) {
+ [0]=>
+ string(10) "original.1"
+ [1]=>
+ string(10) "original.2"
+ [2]=>
+ string(10) "original.3"
+ [3]=>
+ string(5) "new.0"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.2"
+ [6]=>
+ string(5) "new.3"
+ [7]=>
+ string(5) "new.4"
+ [8]=>
+ string(5) "new.5"
+ [9]=>
+ string(5) "new.6"
+ [10]=>
+ string(5) "new.7"
+ [11]=>
+ &string(5) "new.8"
+ [12]=>
+ string(5) "new.9"
+ [13]=>
+ string(6) "new.10"
+ [14]=>
+ string(6) "new.11"
+}
+
+Popping elements off an unreferenced array.
+string(10) "original.1"
+string(10) "original.2"
+string(10) "original.3"
+array(0) {
+}
+
+Popping elements off an unreferenced array, using &$value.
+string(10) "original.1"
+string(10) "original.2"
+array(1) {
+ [0]=>
+ string(10) "original.1"
+} \ No newline at end of file
diff --git a/tests/lang/foreachLoop.003.phpt b/tests/lang/foreachLoop.003.phpt
new file mode 100644
index 0000000..d554d0d
--- /dev/null
+++ b/tests/lang/foreachLoop.003.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Foreach loop tests - error case: not an array.
+--FILE--
+<?php
+echo "\nNot an array.\n";
+$a = TRUE;
+foreach ($a as $v) {
+ var_dump($v);
+}
+
+$a = null;
+foreach ($a as $v) {
+ var_dump($v);
+}
+
+$a = 1;
+foreach ($a as $v) {
+ var_dump($v);
+}
+
+$a = 1.5;
+foreach ($a as $v) {
+ var_dump($v);
+}
+
+$a = "hello";
+foreach ($a as $v) {
+ var_dump($v);
+}
+
+echo "done.\n";
+?>
+--EXPECTF--
+
+Not an array.
+
+Warning: Invalid argument supplied for foreach() in %s on line 4
+
+Warning: Invalid argument supplied for foreach() in %s on line 9
+
+Warning: Invalid argument supplied for foreach() in %s on line 14
+
+Warning: Invalid argument supplied for foreach() in %s on line 19
+
+Warning: Invalid argument supplied for foreach() in %s on line 24
+done.
diff --git a/tests/lang/foreachLoop.004.phpt b/tests/lang/foreachLoop.004.phpt
new file mode 100644
index 0000000..8cc6094
--- /dev/null
+++ b/tests/lang/foreachLoop.004.phpt
@@ -0,0 +1,76 @@
+--TEST--
+Foreach loop tests - using an array element as the $value
+--FILE--
+<?php
+
+$a=array("a", "b", "c");
+$v=array();
+foreach($a as $v[0]) {
+ var_dump($v);
+}
+var_dump($a);
+var_dump($v);
+
+echo "\n";
+$a=array("a", "b", "c");
+$v=array();
+foreach($a as $k=>$v[0]) {
+ var_dump($k, $v);
+}
+var_dump($a);
+var_dump($k, $v);
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(1) "a"
+}
+array(1) {
+ [0]=>
+ string(1) "b"
+}
+array(1) {
+ [0]=>
+ string(1) "c"
+}
+array(3) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ string(1) "b"
+ [2]=>
+ string(1) "c"
+}
+array(1) {
+ [0]=>
+ string(1) "c"
+}
+
+int(0)
+array(1) {
+ [0]=>
+ string(1) "a"
+}
+int(1)
+array(1) {
+ [0]=>
+ string(1) "b"
+}
+int(2)
+array(1) {
+ [0]=>
+ string(1) "c"
+}
+array(3) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ string(1) "b"
+ [2]=>
+ string(1) "c"
+}
+int(2)
+array(1) {
+ [0]=>
+ string(1) "c"
+} \ No newline at end of file
diff --git a/tests/lang/foreachLoop.005.phpt b/tests/lang/foreachLoop.005.phpt
new file mode 100644
index 0000000..ae6ed3a
--- /dev/null
+++ b/tests/lang/foreachLoop.005.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Foreach loop tests - modifying the array during the loop: special case. Behaviour is good since php 5.2.2.
+--FILE--
+<?php
+$a = array("original.0","original.1","original.2");
+foreach ($a as $k=>&$v){
+ $a[$k] = "changed.$k";
+ echo "After changing \$a directly, \$v@$k is: $v\n";
+}
+//--- Expected output:
+//After changing $a directly, $v@0 is: changed.0
+//After changing $a directly, $v@1 is: changed.1
+//After changing $a directly, $v@2 is: changed.2
+//--- Actual output from php.net before 5.2.2:
+//After changing $a directly, $v@0 is: changed.0
+//After changing $a directly, $v@1 is: original.1
+//After changing $a directly, $v@2 is: original.2
+
+?>
+--EXPECT--
+After changing $a directly, $v@0 is: changed.0
+After changing $a directly, $v@1 is: changed.1
+After changing $a directly, $v@2 is: changed.2
diff --git a/tests/lang/foreachLoop.006.phpt b/tests/lang/foreachLoop.006.phpt
new file mode 100644
index 0000000..a90f924
--- /dev/null
+++ b/tests/lang/foreachLoop.006.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Foreach loop tests - error case: key is a reference.
+--FILE--
+<?php
+$a = array("a","b","c");
+foreach ($a as &$k=>$v) {
+ var_dump($v);
+}
+?>
+--EXPECTF--
+Fatal error: Key element cannot be a reference in %s on line 3 \ No newline at end of file
diff --git a/tests/lang/foreachLoop.007.phpt b/tests/lang/foreachLoop.007.phpt
new file mode 100644
index 0000000..f47fdc7
--- /dev/null
+++ b/tests/lang/foreachLoop.007.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Foreach loop tests - error case: reference to constant array.
+--FILE--
+<?php
+echo "\nReference to constant array\n";
+foreach (array(1,2) as &$v) {
+ var_dump($v);
+}
+?>
+--EXPECTF--
+Parse error: %s on line 3
diff --git a/tests/lang/foreachLoop.008.phpt b/tests/lang/foreachLoop.008.phpt
new file mode 100644
index 0000000..787f43b
--- /dev/null
+++ b/tests/lang/foreachLoop.008.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Foreach loop tests - error case: reference to constant array, with key.
+--FILE--
+<?php
+foreach (array(1,2) as $k=>&$v) {
+ var_dump($v);
+}
+?>
+--EXPECTF--
+Fatal error: Cannot create references to elements of a temporary array expression in %s on line 2
diff --git a/tests/lang/foreachLoop.009.phpt b/tests/lang/foreachLoop.009.phpt
new file mode 100644
index 0000000..4586a35
--- /dev/null
+++ b/tests/lang/foreachLoop.009.phpt
@@ -0,0 +1,82 @@
+--TEST--
+Foreach loop tests - foreach operates on the original array if the array is referenced outside the loop.
+--FILE--
+<?php
+// From php.net/foreach:
+// "Unless the array is referenced, foreach operates on a copy of the specified array."
+
+echo "\nRemove elements from a referenced array during loop\n";
+$refedArray=array("original.0", "original.1", "original.2");
+$ref=&$refedArray;
+foreach ($refedArray as $k=>$v1) {
+ array_pop($refedArray);
+ echo "key: $k; value: $v1\n";
+}
+
+echo "\nRemove elements from a referenced array during loop, using &\$value\n";
+$refedArray=array("original.0", "original.1", "original.2");
+$ref=&$refedArray;
+foreach ($refedArray as $k=>&$v2) {
+ array_pop($refedArray);
+ echo "key: $k; value: $v2\n";
+}
+
+echo "\nAdd elements to a referenced array during loop\n";
+$refedArray=array("original.0", "original.1", "original.2");
+$ref=&$refedArray;
+$count=0;
+foreach ($refedArray as $k=>$v3) {
+ array_push($refedArray, "new.$k");
+ echo "key: $k; value: $v3\n";
+
+ if ($count++>5) {
+ echo "Loop detected, as expected.\n";
+ break;
+ }
+}
+
+echo "\nAdd elements to a referenced array during loop, using &\$value\n";
+$refedArray=array("original.0", "original.1", "original.2");
+$ref=&$refedArray;
+$count=0;
+foreach ($refedArray as $k=>&$v4) {
+ array_push($refedArray, "new.$k");
+ echo "key: $k; value: $v4\n";
+
+ if ($count++>5) {
+ echo "Loop detected, as expected.\n";
+ break;
+ }
+}
+
+?>
+--EXPECT--
+
+Remove elements from a referenced array during loop
+key: 0; value: original.0
+key: 1; value: original.1
+
+Remove elements from a referenced array during loop, using &$value
+key: 0; value: original.0
+key: 1; value: original.1
+
+Add elements to a referenced array during loop
+key: 0; value: original.0
+key: 1; value: original.1
+key: 2; value: original.2
+key: 3; value: new.0
+key: 4; value: new.1
+key: 5; value: new.2
+key: 6; value: new.3
+Loop detected, as expected.
+
+Add elements to a referenced array during loop, using &$value
+key: 0; value: original.0
+key: 1; value: original.1
+key: 2; value: original.2
+key: 3; value: new.0
+key: 4; value: new.1
+key: 5; value: new.2
+key: 6; value: new.3
+Loop detected, as expected.
+
diff --git a/tests/lang/foreachLoop.010.phpt b/tests/lang/foreachLoop.010.phpt
new file mode 100644
index 0000000..a7a3e97
--- /dev/null
+++ b/tests/lang/foreachLoop.010.phpt
@@ -0,0 +1,40 @@
+--TEST--
+This test illustrates the impact of invoking destructors when refcount is decremented to 0 on foreach.
+It will pass only if the 'contentious code' in PHPValue.decReferences() is enabled.
+--FILE--
+<?php
+
+$a = array(1,2,3);
+$container = array(&$a);
+
+// From php.net:
+// "Unless the array is referenced, foreach operates on a copy of
+// the specified array and not the array itself."
+// At this point, the array $a is referenced.
+
+// The following line ensures $a is no longer references as a consequence
+// of running the 'destructor' on $container.
+$container = null;
+
+// At this point the array $a is no longer referenced, so foreach should operate on a copy of the array.
+// However, P8 does not invoke 'destructors' when refcount is decremented to 0.
+// Consequently, $a thinks it is still referenced, and foreach will operate on the array itself.
+// This provokes a difference in behaviour when changing the number of elements in the array while
+// iterating over it.
+
+$i=0;
+foreach ($a as $v) {
+ array_push($a, 'new');
+ var_dump($v);
+
+ if (++$i>10) {
+ echo "Infinite loop detected\n";
+ break;
+ }
+}
+
+?>
+--EXPECTF--
+int(1)
+int(2)
+int(3) \ No newline at end of file
diff --git a/tests/lang/foreachLoop.011.phpt b/tests/lang/foreachLoop.011.phpt
new file mode 100644
index 0000000..94cb605
--- /dev/null
+++ b/tests/lang/foreachLoop.011.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Changing from an interable type to a non iterable type during the iteration
+--FILE--
+<?php
+echo "\nChange from array to non iterable:\n";
+$a = array(1,2,3);
+$b=&$a;
+foreach ($a as $v) {
+ var_dump($v);
+ $b=1;
+}
+
+echo "\nChange from object to non iterable:\n";
+$a = new stdClass;
+$a->a=1;
+$a->b=2;
+$b=&$a;
+foreach ($a as $v) {
+ var_dump($v);
+ $b='x';
+}
+
+?>
+--EXPECTF--
+
+Change from array to non iterable:
+int(1)
+
+Warning: Invalid argument supplied for foreach() in %s on line 5
+
+Change from object to non iterable:
+int(1)
+
+Warning: Invalid argument supplied for foreach() in %s on line 15 \ No newline at end of file
diff --git a/tests/lang/foreachLoop.012.phpt b/tests/lang/foreachLoop.012.phpt
new file mode 100644
index 0000000..1165b74
--- /dev/null
+++ b/tests/lang/foreachLoop.012.phpt
@@ -0,0 +1,494 @@
+--TEST--
+Directly modifying an unreferenced array when foreach'ing over it.
+--FILE--
+<?php
+
+define('MAX_LOOPS',5);
+
+function withRefValue($elements, $transform) {
+ echo "\n---( Array with $elements element(s): )---\n";
+ //Build array:
+ for ($i=0; $i<$elements; $i++) {
+ $a[] = "v.$i";
+ }
+ $counter=0;
+
+ echo "--> State of array before loop:\n";
+ var_dump($a);
+
+ echo "--> Do loop:\n";
+ foreach ($a as $k=>$v) {
+ echo " iteration $counter: \$k=$k; \$v=$v\n";
+ eval($transform);
+ $counter++;
+ if ($counter>MAX_LOOPS) {
+ echo " ** Stuck in a loop! **\n";
+ break;
+ }
+ }
+
+ echo "--> State of array after loop:\n";
+ var_dump($a);
+}
+
+
+echo "\nPopping elements off end of an unreferenced array";
+$transform = 'array_pop($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nShift elements off start of an unreferenced array";
+$transform = 'array_shift($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nRemove current element of an unreferenced array";
+$transform = 'unset($a[$k]);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the end of an unreferenced array";
+$transform = 'array_push($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the start of an unreferenced array";
+$transform = 'array_unshift($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+?>
+--EXPECTF--
+
+Popping elements off end of an unreferenced array
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Shift elements off start of an unreferenced array
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Remove current element of an unreferenced array
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Adding elements to the end of an unreferenced array
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(5) "new.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(5) "new.0"
+ [3]=>
+ string(5) "new.1"
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(6) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(5) "new.0"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.2"
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+ [4]=>
+ string(5) "new.0"
+ [5]=>
+ string(5) "new.1"
+ [6]=>
+ string(5) "new.2"
+ [7]=>
+ string(5) "new.3"
+}
+
+
+
+Adding elements to the start of an unreferenced array
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ string(5) "new.0"
+ [1]=>
+ string(3) "v.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(4) {
+ [0]=>
+ string(5) "new.1"
+ [1]=>
+ string(5) "new.0"
+ [2]=>
+ string(3) "v.0"
+ [3]=>
+ string(3) "v.1"
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(6) {
+ [0]=>
+ string(5) "new.2"
+ [1]=>
+ string(5) "new.1"
+ [2]=>
+ string(5) "new.0"
+ [3]=>
+ string(3) "v.0"
+ [4]=>
+ string(3) "v.1"
+ [5]=>
+ string(3) "v.2"
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(5) "new.3"
+ [1]=>
+ string(5) "new.2"
+ [2]=>
+ string(5) "new.1"
+ [3]=>
+ string(5) "new.0"
+ [4]=>
+ string(3) "v.0"
+ [5]=>
+ string(3) "v.1"
+ [6]=>
+ string(3) "v.2"
+ [7]=>
+ string(3) "v.3"
+}
diff --git a/tests/lang/foreachLoop.013.phpt b/tests/lang/foreachLoop.013.phpt
new file mode 100644
index 0000000..3dec119
--- /dev/null
+++ b/tests/lang/foreachLoop.013.phpt
@@ -0,0 +1,555 @@
+--TEST--
+Directly modifying an unreferenced array when foreach'ing over it while using &$value syntax.
+--FILE--
+<?php
+
+define('MAX_LOOPS',5);
+
+function withRefValue($elements, $transform) {
+ echo "\n---( Array with $elements element(s): )---\n";
+ //Build array:
+ for ($i=0; $i<$elements; $i++) {
+ $a[] = "v.$i";
+ }
+ $counter=0;
+
+ echo "--> State of array before loop:\n";
+ var_dump($a);
+
+ echo "--> Do loop:\n";
+ foreach ($a as $k=>&$v) {
+ echo " iteration $counter: \$k=$k; \$v=$v\n";
+ eval($transform);
+ $counter++;
+ if ($counter>MAX_LOOPS) {
+ echo " ** Stuck in a loop! **\n";
+ break;
+ }
+ }
+
+ echo "--> State of array after loop:\n";
+ var_dump($a);
+}
+
+
+echo "\nPopping elements off end of an unreferenced array, using &\$value.";
+$transform = 'array_pop($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nShift elements off start of an unreferenced array, using &\$value.";
+$transform = 'array_shift($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nRemove current element of an unreferenced array, using &\$value.";
+$transform = 'unset($a[$k]);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the end of an unreferenced array, using &\$value.";
+$transform = 'array_push($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the start of an unreferenced array, using &\$value.";
+$transform = 'array_unshift($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+?>
+--EXPECTF--
+
+Popping elements off end of an unreferenced array, using &$value.
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=0; $v=v.0
+ iteration 3: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Shift elements off start of an unreferenced array, using &$value.
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+ iteration 2: $k=0; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+ iteration 2: $k=0; $v=v.2
+ iteration 3: $k=0; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Remove current element of an unreferenced array, using &$value.
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Adding elements to the end of an unreferenced array, using &$value.
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ &string(3) "v.0"
+ [1]=>
+ string(5) "new.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=new.0
+ iteration 3: $k=3; $v=new.1
+ iteration 4: $k=4; $v=new.2
+ iteration 5: $k=5; $v=new.3
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(5) "new.0"
+ [3]=>
+ string(5) "new.1"
+ [4]=>
+ string(5) "new.2"
+ [5]=>
+ &string(5) "new.3"
+ [6]=>
+ string(5) "new.4"
+ [7]=>
+ string(5) "new.5"
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=new.0
+ iteration 4: $k=4; $v=new.1
+ iteration 5: $k=5; $v=new.2
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(9) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(5) "new.0"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ &string(5) "new.2"
+ [6]=>
+ string(5) "new.3"
+ [7]=>
+ string(5) "new.4"
+ [8]=>
+ string(5) "new.5"
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+ iteration 4: $k=4; $v=new.0
+ iteration 5: $k=5; $v=new.1
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(10) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+ [4]=>
+ string(5) "new.0"
+ [5]=>
+ &string(5) "new.1"
+ [6]=>
+ string(5) "new.2"
+ [7]=>
+ string(5) "new.3"
+ [8]=>
+ string(5) "new.4"
+ [9]=>
+ string(5) "new.5"
+}
+
+
+
+Adding elements to the start of an unreferenced array, using &$value.
+---( Array with 1 element(s): )---
+--> State of array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ string(5) "new.0"
+ [1]=>
+ &string(3) "v.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ &string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+}
+
+---( Array with 3 element(s): )---
+--> State of array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(9) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ &string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+ [8]=>
+ string(3) "v.2"
+}
+
+---( Array with 4 element(s): )---
+--> State of array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(10) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ &string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+ [8]=>
+ string(3) "v.2"
+ [9]=>
+ string(3) "v.3"
+}
diff --git a/tests/lang/foreachLoop.014.phpt b/tests/lang/foreachLoop.014.phpt
new file mode 100644
index 0000000..ab3c657
--- /dev/null
+++ b/tests/lang/foreachLoop.014.phpt
@@ -0,0 +1,556 @@
+--TEST--
+Directly modifying a REFERENCED array when foreach'ing over it.
+--FILE--
+<?php
+
+define('MAX_LOOPS',5);
+
+function withRefValue($elements, $transform) {
+ echo "\n---( Array with $elements element(s): )---\n";
+ //Build array:
+ for ($i=0; $i<$elements; $i++) {
+ $a[] = "v.$i";
+ }
+ $counter=0;
+
+ $ref = &$a;
+
+ echo "--> State of referenced array before loop:\n";
+ var_dump($a);
+
+ echo "--> Do loop:\n";
+ foreach ($a as $k=>$v) {
+ echo " iteration $counter: \$k=$k; \$v=$v\n";
+ eval($transform);
+ $counter++;
+ if ($counter>MAX_LOOPS) {
+ echo " ** Stuck in a loop! **\n";
+ break;
+ }
+ }
+
+ echo "--> State of array after loop:\n";
+ var_dump($a);
+}
+
+
+echo "\nPopping elements off end of a referenced array";
+$transform = 'array_pop($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nShift elements off start of a referenced array";
+$transform = 'array_shift($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nRemove current element of a referenced array";
+$transform = 'unset($a[$k]);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the end of a referenced array";
+$transform = 'array_push($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the start of a referenced array";
+$transform = 'array_unshift($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+?>
+--EXPECTF--
+Popping elements off end of a referenced array
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=0; $v=v.0
+ iteration 3: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Shift elements off start of a referenced array
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+ iteration 2: $k=0; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+ iteration 2: $k=0; $v=v.2
+ iteration 3: $k=0; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Remove current element of a referenced array
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Adding elements to the end of a referenced array
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(5) "new.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=new.0
+ iteration 3: $k=3; $v=new.1
+ iteration 4: $k=4; $v=new.2
+ iteration 5: $k=5; $v=new.3
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(5) "new.0"
+ [3]=>
+ string(5) "new.1"
+ [4]=>
+ string(5) "new.2"
+ [5]=>
+ string(5) "new.3"
+ [6]=>
+ string(5) "new.4"
+ [7]=>
+ string(5) "new.5"
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=new.0
+ iteration 4: $k=4; $v=new.1
+ iteration 5: $k=5; $v=new.2
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(9) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(5) "new.0"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.2"
+ [6]=>
+ string(5) "new.3"
+ [7]=>
+ string(5) "new.4"
+ [8]=>
+ string(5) "new.5"
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+ iteration 4: $k=4; $v=new.0
+ iteration 5: $k=5; $v=new.1
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(10) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+ [4]=>
+ string(5) "new.0"
+ [5]=>
+ string(5) "new.1"
+ [6]=>
+ string(5) "new.2"
+ [7]=>
+ string(5) "new.3"
+ [8]=>
+ string(5) "new.4"
+ [9]=>
+ string(5) "new.5"
+}
+
+
+
+Adding elements to the start of a referenced array
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ string(5) "new.0"
+ [1]=>
+ string(3) "v.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(9) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+ [8]=>
+ string(3) "v.2"
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(10) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+ [8]=>
+ string(3) "v.2"
+ [9]=>
+ string(3) "v.3"
+} \ No newline at end of file
diff --git a/tests/lang/foreachLoop.015.phpt b/tests/lang/foreachLoop.015.phpt
new file mode 100644
index 0000000..dfba159
--- /dev/null
+++ b/tests/lang/foreachLoop.015.phpt
@@ -0,0 +1,557 @@
+--TEST--
+Directly modifying a REFERENCED array when foreach'ing over it while using &$value syntax.
+--FILE--
+<?php
+
+define('MAX_LOOPS',5);
+
+function withRefValue($elements, $transform) {
+ echo "\n---( Array with $elements element(s): )---\n";
+ //Build array:
+ for ($i=0; $i<$elements; $i++) {
+ $a[] = "v.$i";
+ }
+ $counter=0;
+
+ $ref = &$a;
+
+ echo "--> State of referenced array before loop:\n";
+ var_dump($a);
+
+ echo "--> Do loop:\n";
+ foreach ($a as $k=>&$v) {
+ echo " iteration $counter: \$k=$k; \$v=$v\n";
+ eval($transform);
+ $counter++;
+ if ($counter>MAX_LOOPS) {
+ echo " ** Stuck in a loop! **\n";
+ break;
+ }
+ }
+
+ echo "--> State of array after loop:\n";
+ var_dump($a);
+}
+
+
+echo "\nPopping elements off end of a referenced array, using &\$value";
+$transform = 'array_pop($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nShift elements off start of a referenced array, using &\$value";
+$transform = 'array_shift($a);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nRemove current element of a referenced array, using &\$value";
+$transform = 'unset($a[$k]);';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the end of a referenced array, using &\$value";
+$transform = 'array_push($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+echo "\n\n\nAdding elements to the start of a referenced array, using &\$value";
+$transform = 'array_unshift($a, "new.$counter");';
+withRefValue(1, $transform);
+withRefValue(2, $transform);
+withRefValue(3, $transform);
+withRefValue(4, $transform);
+
+?>
+--EXPECTF--
+
+Popping elements off end of a referenced array, using &$value
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=0; $v=v.0
+ iteration 3: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Shift elements off start of a referenced array, using &$value
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+ iteration 2: $k=0; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=v.1
+ iteration 2: $k=0; $v=v.2
+ iteration 3: $k=0; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Remove current element of a referenced array, using &$value
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+--> State of array after loop:
+array(0) {
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+--> State of array after loop:
+array(0) {
+}
+
+
+
+Adding elements to the end of a referenced array, using &$value
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ &string(3) "v.0"
+ [1]=>
+ string(5) "new.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=new.0
+ iteration 3: $k=3; $v=new.1
+ iteration 4: $k=4; $v=new.2
+ iteration 5: $k=5; $v=new.3
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(5) "new.0"
+ [3]=>
+ string(5) "new.1"
+ [4]=>
+ string(5) "new.2"
+ [5]=>
+ &string(5) "new.3"
+ [6]=>
+ string(5) "new.4"
+ [7]=>
+ string(5) "new.5"
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=new.0
+ iteration 4: $k=4; $v=new.1
+ iteration 5: $k=5; $v=new.2
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(9) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(5) "new.0"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ &string(5) "new.2"
+ [6]=>
+ string(5) "new.3"
+ [7]=>
+ string(5) "new.4"
+ [8]=>
+ string(5) "new.5"
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=1; $v=v.1
+ iteration 2: $k=2; $v=v.2
+ iteration 3: $k=3; $v=v.3
+ iteration 4: $k=4; $v=new.0
+ iteration 5: $k=5; $v=new.1
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(10) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+ [4]=>
+ string(5) "new.0"
+ [5]=>
+ &string(5) "new.1"
+ [6]=>
+ string(5) "new.2"
+ [7]=>
+ string(5) "new.3"
+ [8]=>
+ string(5) "new.4"
+ [9]=>
+ string(5) "new.5"
+}
+
+
+
+Adding elements to the start of a referenced array, using &$value
+---( Array with 1 element(s): )---
+--> State of referenced array before loop:
+array(1) {
+ [0]=>
+ string(3) "v.0"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+--> State of array after loop:
+array(2) {
+ [0]=>
+ string(5) "new.0"
+ [1]=>
+ &string(3) "v.0"
+}
+
+---( Array with 2 element(s): )---
+--> State of referenced array before loop:
+array(2) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(8) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ &string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+}
+
+---( Array with 3 element(s): )---
+--> State of referenced array before loop:
+array(3) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(9) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ &string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+ [8]=>
+ string(3) "v.2"
+}
+
+---( Array with 4 element(s): )---
+--> State of referenced array before loop:
+array(4) {
+ [0]=>
+ string(3) "v.0"
+ [1]=>
+ string(3) "v.1"
+ [2]=>
+ string(3) "v.2"
+ [3]=>
+ string(3) "v.3"
+}
+--> Do loop:
+ iteration 0: $k=0; $v=v.0
+ iteration 1: $k=0; $v=new.0
+ iteration 2: $k=0; $v=new.1
+ iteration 3: $k=0; $v=new.2
+ iteration 4: $k=0; $v=new.3
+ iteration 5: $k=0; $v=new.4
+ ** Stuck in a loop! **
+--> State of array after loop:
+array(10) {
+ [0]=>
+ string(5) "new.5"
+ [1]=>
+ &string(5) "new.4"
+ [2]=>
+ string(5) "new.3"
+ [3]=>
+ string(5) "new.2"
+ [4]=>
+ string(5) "new.1"
+ [5]=>
+ string(5) "new.0"
+ [6]=>
+ string(3) "v.0"
+ [7]=>
+ string(3) "v.1"
+ [8]=>
+ string(3) "v.2"
+ [9]=>
+ string(3) "v.3"
+}
diff --git a/tests/lang/foreachLoop.016.phpt b/tests/lang/foreachLoop.016.phpt
new file mode 100644
index 0000000..d570aba
--- /dev/null
+++ b/tests/lang/foreachLoop.016.phpt
@@ -0,0 +1,206 @@
+--TEST--
+Ensure foreach splits the iterated entity from its cow reference set, for all sorts of iterated entities.
+--FILE--
+<?php
+ error_reporting(E_ALL & ~E_STRICT);
+
+ echo "\n" . '$a' . "\n";
+ $b = $a = array('original');
+ foreach($a as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '${\'a\'}' . "\n";
+ $b = $a = array('original');
+ foreach(${'a'} as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$$a' . "\n";
+ $a = 'blah';
+ $$a = array('original');
+ $b = $$a;
+ foreach($$a as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$a[0]' . "\n";
+ $b = $a[0] = array('original');
+ foreach($a[0] as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$a[0][0]' . "\n";
+ $b = $a[0][0] = array('original');
+ foreach($a[0][0] as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$a->b' . "\n";
+ $b = $a->b = array('original');
+ foreach($a->b as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$a->b->c' . "\n";
+ $b = $a->b->c = array('original');
+ foreach($a->b as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$a->b[0]' . "\n";
+ $b = $a->b[0] = array('original');
+ foreach($a->b[0] as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$a->b[0][0]' . "\n";
+ $b = $a->b[0][0] = array('original');
+ foreach($a->b[0][0] as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . '$a->b[0]->c' . "\n";
+ $b = $a->b[0]->c = array('original');
+ foreach($a->b[0]->c as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ class C {
+ public static $a;
+ }
+
+ echo "\n" . 'C::$a' . "\n";
+ C::$a = array('original');
+ $b = C::$a;
+ foreach(C::$a as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset($a, $b);
+
+ echo "\n" . 'C::$a[0]' . "\n";
+ C::$a[0] = array('original');
+ $b = C::$a[0];
+ foreach(C::$a[0] as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset(C::$a[0], $b);
+
+ echo "\n" . 'C::$a[0]->b' . "\n";
+ C::$a[0]->b = array('original');
+ $b = C::$a[0]->b;
+ foreach(C::$a[0]->b as $k=>&$v) {
+ $v = 'changed';
+ }
+ var_dump($b);
+ unset(C::$a[0]->b, $b);
+?>
+--EXPECTF--
+
+$a
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+${'a'}
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$$a
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$a[0]
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$a[0][0]
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$a->b
+
+Warning: Creating default object from empty value in %s on line %d
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$a->b->c
+
+Warning: Creating default object from empty value in %s on line %d
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$a->b[0]
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$a->b[0][0]
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+$a->b[0]->c
+
+Warning: Creating default object from empty value in %s on line %d
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+C::$a
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+C::$a[0]
+array(1) {
+ [0]=>
+ string(8) "original"
+}
+
+C::$a[0]->b
+
+Warning: Creating default object from empty value in %s on line %d
+array(1) {
+ [0]=>
+ string(8) "original"
+}
diff --git a/tests/lang/foreachLoop.017.phpt b/tests/lang/foreachLoop.017.phpt
new file mode 100644
index 0000000..3d2618e
--- /dev/null
+++ b/tests/lang/foreachLoop.017.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Ensure foreach works with arrays with Binary keys.
+--FILE--
+<?php
+$a = array ( "\x90" => 10 );
+foreach ($a as $val=>$key) echo $key;
+echo "\nDone\n";
+?>
+--EXPECTF--
+10
+Done \ No newline at end of file
diff --git a/tests/lang/foreachLoopIterator.001.phpt b/tests/lang/foreachLoopIterator.001.phpt
new file mode 100644
index 0000000..c049cb7
--- /dev/null
+++ b/tests/lang/foreachLoopIterator.001.phpt
@@ -0,0 +1,134 @@
+--TEST--
+foreach with Iterator.
+--FILE--
+<?php
+
+class MealIterator implements Iterator {
+ private $pos=0;
+ private $myContent=array("breakfast", "lunch", "dinner");
+
+ public function valid() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->pos<3;
+ }
+
+ public function next() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->myContent[$this->pos++];
+ }
+
+ public function rewind() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ $this->pos=0;
+ }
+
+ public function current() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->myContent[$this->pos];
+ }
+
+ public function key() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return "meal " . $this->pos;
+ }
+
+}
+
+$f = new MealIterator;
+var_dump($f);
+
+echo "-----( Simple iteration: )-----\n";
+foreach ($f as $k=>$v) {
+ echo "$k => $v\n";
+}
+
+$f->rewind();
+
+$indent = " ";
+
+echo "\n\n\n-----( Nested iteration: )-----\n";
+$count=1;
+foreach ($f as $k=>$v) {
+ echo "\nTop level " . $count++ . ": \n";
+ echo "$k => $v\n";
+ $indent = " ";
+ foreach ($f as $k=>$v) {
+ echo " $k => $v\n";
+ }
+ $indent = " ";
+
+}
+
+?>
+===DONE===
+--EXPECTF--
+object(MealIterator)#%d (2) {
+ ["pos":"MealIterator":private]=>
+ int(0)
+ ["myContent":"MealIterator":private]=>
+ array(3) {
+ [0]=>
+ string(9) "breakfast"
+ [1]=>
+ string(5) "lunch"
+ [2]=>
+ string(6) "dinner"
+ }
+}
+-----( Simple iteration: )-----
+--> MealIterator::rewind (0)
+--> MealIterator::valid (0)
+--> MealIterator::current (0)
+--> MealIterator::key (0)
+meal 0 => breakfast
+--> MealIterator::next (0)
+--> MealIterator::valid (1)
+--> MealIterator::current (1)
+--> MealIterator::key (1)
+meal 1 => lunch
+--> MealIterator::next (1)
+--> MealIterator::valid (2)
+--> MealIterator::current (2)
+--> MealIterator::key (2)
+meal 2 => dinner
+--> MealIterator::next (2)
+--> MealIterator::valid (3)
+--> MealIterator::rewind (3)
+
+
+
+-----( Nested iteration: )-----
+ --> MealIterator::rewind (0)
+ --> MealIterator::valid (0)
+ --> MealIterator::current (0)
+ --> MealIterator::key (0)
+
+Top level 1:
+meal 0 => breakfast
+ --> MealIterator::rewind (0)
+ --> MealIterator::valid (0)
+ --> MealIterator::current (0)
+ --> MealIterator::key (0)
+ meal 0 => breakfast
+ --> MealIterator::next (0)
+ --> MealIterator::valid (1)
+ --> MealIterator::current (1)
+ --> MealIterator::key (1)
+ meal 1 => lunch
+ --> MealIterator::next (1)
+ --> MealIterator::valid (2)
+ --> MealIterator::current (2)
+ --> MealIterator::key (2)
+ meal 2 => dinner
+ --> MealIterator::next (2)
+ --> MealIterator::valid (3)
+ --> MealIterator::next (3)
+
+Notice: Undefined offset: 3 in %s on line %d
+ --> MealIterator::valid (4)
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/foreachLoopIterator.002.phpt b/tests/lang/foreachLoopIterator.002.phpt
new file mode 100644
index 0000000..f40e09b
--- /dev/null
+++ b/tests/lang/foreachLoopIterator.002.phpt
@@ -0,0 +1,24 @@
+--TEST--
+foreach with iterator and &$value reference
+--FILE--
+<?php
+
+class MyIterator implements Iterator {
+ public function valid() { return true; }
+ public function next() { }
+ public function rewind() { }
+ public function current() { }
+ public function key() { }
+}
+
+$f = new MyIterator;
+echo "-----( Try to iterate with &\$value: )-----\n";
+foreach ($f as $k=>&$v) {
+ echo "$k => $v\n";
+}
+
+?>
+--EXPECTF--
+-----( Try to iterate with &$value: )-----
+
+Fatal error: An iterator cannot be used with foreach by reference in %s on line 13 \ No newline at end of file
diff --git a/tests/lang/foreachLoopIteratorAggregate.001.phpt b/tests/lang/foreachLoopIteratorAggregate.001.phpt
new file mode 100644
index 0000000..b20d3ea
--- /dev/null
+++ b/tests/lang/foreachLoopIteratorAggregate.001.phpt
@@ -0,0 +1,270 @@
+--TEST--
+foreach with iteratorAggregate
+--FILE--
+<?php
+class EnglishMealIterator implements Iterator {
+ private $pos=0;
+ private $myContent=array("breakfast", "dinner", "tea");
+
+ public function valid() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->pos < count($this->myContent);
+ }
+
+ public function next() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ $this->pos++;
+ }
+
+ public function rewind() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ $this->pos=0;
+ }
+
+ public function current() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->myContent[$this->pos];
+ }
+
+ public function key() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return "meal " . $this->pos;
+ }
+
+}
+
+class FrenchMealIterator implements Iterator {
+ private $pos=0;
+ private $myContent=array("petit dejeuner", "dejeuner", "gouter", "dinner");
+
+ public function valid() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->pos < count($this->myContent);
+ }
+
+ public function next() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ $this->pos++;
+ }
+
+ public function rewind() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ $this->pos=0;
+ }
+
+ public function current() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->myContent[$this->pos];
+ }
+
+ public function key() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return "meal " . $this->pos;
+ }
+
+}
+
+
+Class EuropeanMeals implements IteratorAggregate {
+
+ private $storedEnglishMealIterator;
+ private $storedFrenchMealIterator;
+
+ public function __construct() {
+ $this->storedEnglishMealIterator = new EnglishMealIterator;
+ $this->storedFrenchMealIterator = new FrenchMealIterator;
+ }
+
+ public function getIterator() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . "\n";
+
+ //Alternate between English and French meals
+ static $i = 0;
+ if ($i++%2 == 0) {
+ return $this->storedEnglishMealIterator;
+ } else {
+ return $this->storedFrenchMealIterator;
+ }
+ }
+
+}
+
+$f = new EuropeanMeals;
+var_dump($f);
+
+echo "-----( Simple iteration 1: )-----\n";
+foreach ($f as $k=>$v) {
+ echo "$k => $v\n";
+}
+echo "-----( Simple iteration 2: )-----\n";
+foreach ($f as $k=>$v) {
+ echo "$k => $v\n";
+}
+
+
+$indent = " ";
+echo "\n\n\n-----( Nested iteration: )-----\n";
+$count=1;
+foreach ($f as $k=>$v) {
+ echo "\nTop level " . $count++ . ": \n";
+ echo "$k => $v\n";
+ $indent = " ";
+ foreach ($f as $k=>$v) {
+ echo " $k => $v\n";
+ }
+ $indent = " ";
+}
+
+
+?>
+===DONE===
+--EXPECTF--
+object(EuropeanMeals)#%d (2) {
+ ["storedEnglishMealIterator":"EuropeanMeals":private]=>
+ object(EnglishMealIterator)#%d (2) {
+ ["pos":"EnglishMealIterator":private]=>
+ int(0)
+ ["myContent":"EnglishMealIterator":private]=>
+ array(3) {
+ [0]=>
+ string(9) "breakfast"
+ [1]=>
+ string(6) "dinner"
+ [2]=>
+ string(3) "tea"
+ }
+ }
+ ["storedFrenchMealIterator":"EuropeanMeals":private]=>
+ object(FrenchMealIterator)#%d (2) {
+ ["pos":"FrenchMealIterator":private]=>
+ int(0)
+ ["myContent":"FrenchMealIterator":private]=>
+ array(4) {
+ [0]=>
+ string(14) "petit dejeuner"
+ [1]=>
+ string(8) "dejeuner"
+ [2]=>
+ string(6) "gouter"
+ [3]=>
+ string(6) "dinner"
+ }
+ }
+}
+-----( Simple iteration 1: )-----
+--> EuropeanMeals::getIterator
+--> EnglishMealIterator::rewind (0)
+--> EnglishMealIterator::valid (0)
+--> EnglishMealIterator::current (0)
+--> EnglishMealIterator::key (0)
+meal 0 => breakfast
+--> EnglishMealIterator::next (0)
+--> EnglishMealIterator::valid (1)
+--> EnglishMealIterator::current (1)
+--> EnglishMealIterator::key (1)
+meal 1 => dinner
+--> EnglishMealIterator::next (1)
+--> EnglishMealIterator::valid (2)
+--> EnglishMealIterator::current (2)
+--> EnglishMealIterator::key (2)
+meal 2 => tea
+--> EnglishMealIterator::next (2)
+--> EnglishMealIterator::valid (3)
+-----( Simple iteration 2: )-----
+--> EuropeanMeals::getIterator
+--> FrenchMealIterator::rewind (0)
+--> FrenchMealIterator::valid (0)
+--> FrenchMealIterator::current (0)
+--> FrenchMealIterator::key (0)
+meal 0 => petit dejeuner
+--> FrenchMealIterator::next (0)
+--> FrenchMealIterator::valid (1)
+--> FrenchMealIterator::current (1)
+--> FrenchMealIterator::key (1)
+meal 1 => dejeuner
+--> FrenchMealIterator::next (1)
+--> FrenchMealIterator::valid (2)
+--> FrenchMealIterator::current (2)
+--> FrenchMealIterator::key (2)
+meal 2 => gouter
+--> FrenchMealIterator::next (2)
+--> FrenchMealIterator::valid (3)
+--> FrenchMealIterator::current (3)
+--> FrenchMealIterator::key (3)
+meal 3 => dinner
+--> FrenchMealIterator::next (3)
+--> FrenchMealIterator::valid (4)
+
+
+
+-----( Nested iteration: )-----
+ --> EuropeanMeals::getIterator
+ --> EnglishMealIterator::rewind (3)
+ --> EnglishMealIterator::valid (0)
+ --> EnglishMealIterator::current (0)
+ --> EnglishMealIterator::key (0)
+
+Top level 1:
+meal 0 => breakfast
+ --> EuropeanMeals::getIterator
+ --> FrenchMealIterator::rewind (4)
+ --> FrenchMealIterator::valid (0)
+ --> FrenchMealIterator::current (0)
+ --> FrenchMealIterator::key (0)
+ meal 0 => petit dejeuner
+ --> FrenchMealIterator::next (0)
+ --> FrenchMealIterator::valid (1)
+ --> FrenchMealIterator::current (1)
+ --> FrenchMealIterator::key (1)
+ meal 1 => dejeuner
+ --> FrenchMealIterator::next (1)
+ --> FrenchMealIterator::valid (2)
+ --> FrenchMealIterator::current (2)
+ --> FrenchMealIterator::key (2)
+ meal 2 => gouter
+ --> FrenchMealIterator::next (2)
+ --> FrenchMealIterator::valid (3)
+ --> FrenchMealIterator::current (3)
+ --> FrenchMealIterator::key (3)
+ meal 3 => dinner
+ --> FrenchMealIterator::next (3)
+ --> FrenchMealIterator::valid (4)
+ --> EnglishMealIterator::next (0)
+ --> EnglishMealIterator::valid (1)
+ --> EnglishMealIterator::current (1)
+ --> EnglishMealIterator::key (1)
+
+Top level 2:
+meal 1 => dinner
+ --> EuropeanMeals::getIterator
+ --> EnglishMealIterator::rewind (1)
+ --> EnglishMealIterator::valid (0)
+ --> EnglishMealIterator::current (0)
+ --> EnglishMealIterator::key (0)
+ meal 0 => breakfast
+ --> EnglishMealIterator::next (0)
+ --> EnglishMealIterator::valid (1)
+ --> EnglishMealIterator::current (1)
+ --> EnglishMealIterator::key (1)
+ meal 1 => dinner
+ --> EnglishMealIterator::next (1)
+ --> EnglishMealIterator::valid (2)
+ --> EnglishMealIterator::current (2)
+ --> EnglishMealIterator::key (2)
+ meal 2 => tea
+ --> EnglishMealIterator::next (2)
+ --> EnglishMealIterator::valid (3)
+ --> EnglishMealIterator::next (3)
+ --> EnglishMealIterator::valid (4)
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/foreachLoopIteratorAggregate.002.phpt b/tests/lang/foreachLoopIteratorAggregate.002.phpt
new file mode 100644
index 0000000..eef4302
--- /dev/null
+++ b/tests/lang/foreachLoopIteratorAggregate.002.phpt
@@ -0,0 +1,53 @@
+--TEST--
+IteratorAggregate::getIterator bad return type
+--FILE--
+<?php
+
+class bad1 implements IteratorAggregate {
+ function getIterator() {
+ return null;
+ }
+}
+
+class bad2 implements IteratorAggregate {
+ function getIterator() {
+ return new stdClass;
+ }
+}
+
+class bad3 implements IteratorAggregate {
+ function getIterator() {
+ return 1;
+ }
+}
+
+class bad4 implements IteratorAggregate {
+ function getIterator() {
+ return array(1,2,3);
+ }
+}
+
+
+function f($className) {
+ try {
+ foreach (new $className as $k=>$v) {
+ echo "$k => $v\n";
+ }
+ } catch (Exception $e) {
+ echo $e->getLine() . ": " . $e->getMessage() ."\n";
+ }
+}
+
+f("bad1");
+f("bad2");
+f("bad3");
+f("bad4");
+
+?>
+===DONE===
+--EXPECTF--
+30: Objects returned by bad1::getIterator() must be traversable or implement interface Iterator
+30: Objects returned by bad2::getIterator() must be traversable or implement interface Iterator
+30: Objects returned by bad3::getIterator() must be traversable or implement interface Iterator
+30: Objects returned by bad4::getIterator() must be traversable or implement interface Iterator
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/foreachLoopIteratorAggregate.003.phpt b/tests/lang/foreachLoopIteratorAggregate.003.phpt
new file mode 100644
index 0000000..0a0e23c
--- /dev/null
+++ b/tests/lang/foreachLoopIteratorAggregate.003.phpt
@@ -0,0 +1,133 @@
+--TEST--
+foreach with nested iteratorAggregates
+--FILE--
+<?php
+class EnglishMealIterator implements Iterator {
+ private $pos=0;
+ private $myContent=array("breakfast", "dinner", "tea");
+
+ public function valid() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->pos<3;
+ }
+
+ public function next() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->myContent[$this->pos++];
+ }
+
+ public function rewind() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ $this->pos=0;
+ }
+
+ public function current() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return $this->myContent[$this->pos];
+ }
+
+ public function key() {
+ global $indent;
+ echo "$indent--> " . __METHOD__ . " ($this->pos)\n";
+ return "meal " . $this->pos;
+ }
+
+}
+
+class A1 implements IteratorAggregate {
+ function getIterator() {
+ return new EnglishMealIterator;
+ }
+}
+
+class A2 implements IteratorAggregate {
+ function getIterator() {
+ return new A1;
+ }
+}
+
+class A3 implements IteratorAggregate {
+ function getIterator() {
+ return new A2;
+ }
+}
+
+echo "\n-----( A1: )-----\n";
+foreach (new A1 as $k=>$v) {
+ echo "$k => $v\n";
+}
+
+echo "\n-----( A2: )-----\n";
+foreach (new A2 as $k=>$v) {
+ echo "$k => $v\n";
+}
+
+echo "\n-----( A3: )-----\n";
+foreach (new A3 as $k=>$v) {
+ echo "$k => $v\n";
+}
+
+?>
+===DONE===
+--EXPECTF--
+-----( A1: )-----
+--> EnglishMealIterator::rewind (0)
+--> EnglishMealIterator::valid (0)
+--> EnglishMealIterator::current (0)
+--> EnglishMealIterator::key (0)
+meal 0 => breakfast
+--> EnglishMealIterator::next (0)
+--> EnglishMealIterator::valid (1)
+--> EnglishMealIterator::current (1)
+--> EnglishMealIterator::key (1)
+meal 1 => dinner
+--> EnglishMealIterator::next (1)
+--> EnglishMealIterator::valid (2)
+--> EnglishMealIterator::current (2)
+--> EnglishMealIterator::key (2)
+meal 2 => tea
+--> EnglishMealIterator::next (2)
+--> EnglishMealIterator::valid (3)
+
+-----( A2: )-----
+--> EnglishMealIterator::rewind (0)
+--> EnglishMealIterator::valid (0)
+--> EnglishMealIterator::current (0)
+--> EnglishMealIterator::key (0)
+meal 0 => breakfast
+--> EnglishMealIterator::next (0)
+--> EnglishMealIterator::valid (1)
+--> EnglishMealIterator::current (1)
+--> EnglishMealIterator::key (1)
+meal 1 => dinner
+--> EnglishMealIterator::next (1)
+--> EnglishMealIterator::valid (2)
+--> EnglishMealIterator::current (2)
+--> EnglishMealIterator::key (2)
+meal 2 => tea
+--> EnglishMealIterator::next (2)
+--> EnglishMealIterator::valid (3)
+
+-----( A3: )-----
+--> EnglishMealIterator::rewind (0)
+--> EnglishMealIterator::valid (0)
+--> EnglishMealIterator::current (0)
+--> EnglishMealIterator::key (0)
+meal 0 => breakfast
+--> EnglishMealIterator::next (0)
+--> EnglishMealIterator::valid (1)
+--> EnglishMealIterator::current (1)
+--> EnglishMealIterator::key (1)
+meal 1 => dinner
+--> EnglishMealIterator::next (1)
+--> EnglishMealIterator::valid (2)
+--> EnglishMealIterator::current (2)
+--> EnglishMealIterator::key (2)
+meal 2 => tea
+--> EnglishMealIterator::next (2)
+--> EnglishMealIterator::valid (3)
+===DONE===
diff --git a/tests/lang/foreachLoopIteratorAggregate.004.phpt b/tests/lang/foreachLoopIteratorAggregate.004.phpt
new file mode 100644
index 0000000..9a1e612
--- /dev/null
+++ b/tests/lang/foreachLoopIteratorAggregate.004.phpt
@@ -0,0 +1,104 @@
+--TEST--
+Duplicate of zend test tests/classes/iterators_002.phpt without expected output from destructor
+--FILE--
+<?php
+class c_iter implements Iterator {
+
+ private $obj;
+ private $num = 0;
+
+ function __construct($obj) {
+ echo __METHOD__ . "\n";
+ $this->obj = $obj;
+ }
+ function rewind() {
+ echo __METHOD__ . "\n";
+ $this->num = 0;
+ }
+ function valid() {
+ $more = $this->num < $this->obj->max;
+ echo __METHOD__ . ' = ' .($more ? 'true' : 'false') . "\n";
+ return $more;
+ }
+ function current() {
+ echo __METHOD__ . "\n";
+ return $this->num;
+ }
+ function next() {
+ echo __METHOD__ . "\n";
+ $this->num++;
+ }
+ function key() {
+ echo __METHOD__ . "\n";
+ switch($this->num) {
+ case 0: return "1st";
+ case 1: return "2nd";
+ case 2: return "3rd";
+ default: return "???";
+ }
+ }
+ function __destruct() {
+ }
+}
+
+class c implements IteratorAggregate {
+
+ public $max = 3;
+
+ function getIterator() {
+ echo __METHOD__ . "\n";
+ return new c_iter($this);
+ }
+ function __destruct() {
+ }
+}
+
+$t = new c();
+
+foreach($t as $k => $v) {
+ foreach($t as $w) {
+ echo "double:$v:$w\n";
+ break;
+ }
+}
+
+unset($t);
+
+?>
+===DONE===
+--EXPECT--
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+c_iter::key
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:0:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c_iter::key
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:1:0
+c_iter::next
+c_iter::valid = true
+c_iter::current
+c_iter::key
+c::getIterator
+c_iter::__construct
+c_iter::rewind
+c_iter::valid = true
+c_iter::current
+double:2:0
+c_iter::next
+c_iter::valid = false
+===DONE===
diff --git a/tests/lang/foreachLoopObjects.001.phpt b/tests/lang/foreachLoopObjects.001.phpt
new file mode 100644
index 0000000..e6047b7
--- /dev/null
+++ b/tests/lang/foreachLoopObjects.001.phpt
@@ -0,0 +1,69 @@
+--TEST--
+Foreach loop on objects - basic loop with just value and key => value.
+--FILE--
+<?php
+
+class C {
+ public $a = "Original a";
+ public $b = "Original b";
+ public $c = "Original c";
+ protected $d = "Original d";
+ private $e = "Original e";
+
+}
+
+echo "\n\nSimple loop.\n";
+$obj = new C;
+foreach ($obj as $v) {
+ var_dump($v);
+}
+foreach ($obj as $k => $v) {
+ var_dump($k, $v);
+}
+echo "\nCheck key and value after the loop.\n";
+var_dump($k, $v);
+
+
+echo "\n\nObject instantiated inside loop.\n";
+foreach (new C as $v) {
+ var_dump($v);
+}
+foreach (new C as $k => $v) {
+ var_dump($k, $v);
+}
+echo "\nCheck key and value after the loop.\n";
+var_dump($k, $v);
+?>
+--EXPECTF--
+
+
+Simple loop.
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(1) "a"
+string(10) "Original a"
+string(1) "b"
+string(10) "Original b"
+string(1) "c"
+string(10) "Original c"
+
+Check key and value after the loop.
+string(1) "c"
+string(10) "Original c"
+
+
+Object instantiated inside loop.
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(1) "a"
+string(10) "Original a"
+string(1) "b"
+string(10) "Original b"
+string(1) "c"
+string(10) "Original c"
+
+Check key and value after the loop.
+string(1) "c"
+string(10) "Original c" \ No newline at end of file
diff --git a/tests/lang/foreachLoopObjects.002.phpt b/tests/lang/foreachLoopObjects.002.phpt
new file mode 100644
index 0000000..0b06f2b
--- /dev/null
+++ b/tests/lang/foreachLoopObjects.002.phpt
@@ -0,0 +1,587 @@
+--TEST--
+Foreach loop tests - visibility.
+--FILE--
+<?php
+
+class C {
+ public $a = "Original a";
+ public $b = "Original b";
+ public $c = "Original c";
+ protected $d = "Original d";
+ private $e = "Original e";
+
+ function doForEachC() {
+ echo "in C::doForEachC\n";
+ foreach ($this as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+ }
+ }
+
+ static function doForEach($obj) {
+ echo "in C::doForEach\n";
+ foreach ($obj as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+ }
+ }
+
+ function doForEachOnThis() {
+ echo "in C::doForEachOnThis\n";
+ foreach ($this as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+ }
+ }
+
+}
+
+class D extends C {
+
+ private $f = "Original f";
+ protected $g = "Original g";
+
+ static function doForEach($obj) {
+ echo "in D::doForEach\n";
+ foreach ($obj as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+ }
+ }
+
+ function doForEachOnThis() {
+ echo "in D::doForEachOnThis\n";
+ foreach ($this as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+ }
+ }
+}
+
+class E extends D {
+ public $a = "Overridden a";
+ public $b = "Overridden b";
+ public $c = "Overridden c";
+ protected $d = "Overridden d";
+ private $e = "Overridden e";
+
+ static function doForEach($obj) {
+ echo "in E::doForEach\n";
+ foreach ($obj as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+ }
+ }
+
+ function doForEachOnThis() {
+ echo "in E::doForEachOnThis\n";
+ foreach ($this as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+ }
+ }
+}
+
+echo "\n\nIterate over various generations from within overridden methods:\n";
+echo "\n--> Using instance of C:\n";
+$myC = new C;
+$myC->doForEachOnThis();
+var_dump($myC);
+echo "\n--> Using instance of D:\n";
+$myD = new D;
+$myD->doForEachOnThis();
+var_dump($myD);
+echo "\n--> Using instance of E:\n";
+$myE = new E;
+$myE->doForEachOnThis();
+var_dump($myE);
+
+echo "\n\nIterate over various generations from within an inherited method:\n";
+echo "\n--> Using instance of C:\n";
+$myC = new C;
+$myC->doForEachC();
+var_dump($myC);
+echo "\n--> Using instance of D:\n";
+$myD = new D;
+$myD->doForEachC();
+var_dump($myD);
+echo "\n--> Using instance of E:\n";
+$myE = new E;
+$myE->doForEachC();
+var_dump($myE);
+
+echo "\n\nIterate over various generations from within an overridden static method:\n";
+echo "\n--> Using instance of C:\n";
+$myC = new C;
+C::doForEach($myC);
+var_dump($myC);
+$myC = new C;
+D::doForEach($myC);
+var_dump($myC);
+$myC = new C;
+E::doForEach($myC);
+var_dump($myC);
+echo "\n--> Using instance of D:\n";
+$myD = new D;
+C::doForEach($myD);
+var_dump($myD);
+$myD = new D;
+D::doForEach($myD);
+var_dump($myD);
+$myD = new D;
+E::doForEach($myD);
+var_dump($myD);
+echo "\n--> Using instance of E:\n";
+$myE = new E;
+C::doForEach($myE);
+var_dump($myE);
+$myE = new E;
+D::doForEach($myE);
+var_dump($myE);
+$myE = new E;
+E::doForEach($myE);
+var_dump($myE);
+
+
+echo "\n\nIterate over various generations from outside the object:\n";
+echo "\n--> Using instance of C:\n";
+$myC = new C;
+foreach ($myC as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+}
+var_dump($myC);
+echo "\n--> Using instance of D:\n";
+$myD = new D;
+foreach ($myD as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+}
+var_dump($myD);
+echo "\n--> Using instance of E:\n";
+$myE = new E;
+foreach ($myE as $k=>&$v) {
+ var_dump($v);
+ $v="changed.$k";
+}
+var_dump($myE);
+?>
+===DONE===
+--EXPECTF--
+Iterate over various generations from within overridden methods:
+
+--> Using instance of C:
+in C::doForEachOnThis
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+string(10) "Original e"
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(9) "changed.e"
+}
+
+--> Using instance of D:
+in D::doForEachOnThis
+string(10) "Original f"
+string(10) "Original g"
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+object(D)#%d (7) {
+ ["f":"D":private]=>
+ string(9) "changed.f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+--> Using instance of E:
+in E::doForEachOnThis
+string(12) "Overridden a"
+string(12) "Overridden b"
+string(12) "Overridden c"
+string(12) "Overridden d"
+string(12) "Overridden e"
+string(10) "Original g"
+object(E)#%d (8) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"E":private]=>
+ string(9) "changed.e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+
+Iterate over various generations from within an inherited method:
+
+--> Using instance of C:
+in C::doForEachC
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+string(10) "Original e"
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(9) "changed.e"
+}
+
+--> Using instance of D:
+in C::doForEachC
+string(10) "Original g"
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+string(10) "Original e"
+object(D)#%d (7) {
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(9) "changed.e"
+}
+
+--> Using instance of E:
+in C::doForEachC
+string(12) "Overridden a"
+string(12) "Overridden b"
+string(12) "Overridden c"
+string(12) "Overridden d"
+string(10) "Original g"
+string(10) "Original e"
+object(E)#%d (8) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["e":"C":private]=>
+ string(9) "changed.e"
+}
+
+
+Iterate over various generations from within an overridden static method:
+
+--> Using instance of C:
+in C::doForEach
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+string(10) "Original e"
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(9) "changed.e"
+}
+in D::doForEach
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+in E::doForEach
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+--> Using instance of D:
+in C::doForEach
+string(10) "Original g"
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+string(10) "Original e"
+object(D)#%d (7) {
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(9) "changed.e"
+}
+in D::doForEach
+string(10) "Original f"
+string(10) "Original g"
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+object(D)#%d (7) {
+ ["f":"D":private]=>
+ string(9) "changed.f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+in E::doForEach
+string(10) "Original g"
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+object(D)#%d (7) {
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+--> Using instance of E:
+in C::doForEach
+string(12) "Overridden a"
+string(12) "Overridden b"
+string(12) "Overridden c"
+string(12) "Overridden d"
+string(10) "Original g"
+string(10) "Original e"
+object(E)#%d (8) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["e":"C":private]=>
+ string(9) "changed.e"
+}
+in D::doForEach
+string(12) "Overridden a"
+string(12) "Overridden b"
+string(12) "Overridden c"
+string(12) "Overridden d"
+string(10) "Original f"
+string(10) "Original g"
+object(E)#%d (8) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
+ ["f":"D":private]=>
+ string(9) "changed.f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+in E::doForEach
+string(12) "Overridden a"
+string(12) "Overridden b"
+string(12) "Overridden c"
+string(12) "Overridden d"
+string(12) "Overridden e"
+string(10) "Original g"
+object(E)#%d (8) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(9) "changed.d"
+ ["e":"E":private]=>
+ string(9) "changed.e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(9) "changed.g"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+
+Iterate over various generations from outside the object:
+
+--> Using instance of C:
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ &string(9) "changed.c"
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+--> Using instance of D:
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+object(D)#%d (7) {
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(10) "Original g"
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ &string(9) "changed.c"
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+--> Using instance of E:
+string(12) "Overridden a"
+string(12) "Overridden b"
+string(12) "Overridden c"
+object(E)#%d (8) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ &string(9) "changed.c"
+ ["d":protected]=>
+ string(12) "Overridden d"
+ ["e":"E":private]=>
+ string(12) "Overridden e"
+ ["f":"D":private]=>
+ string(10) "Original f"
+ ["g":protected]=>
+ string(10) "Original g"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/foreachLoopObjects.003.phpt b/tests/lang/foreachLoopObjects.003.phpt
new file mode 100644
index 0000000..e3747bf
--- /dev/null
+++ b/tests/lang/foreachLoopObjects.003.phpt
@@ -0,0 +1,250 @@
+--TEST--
+Foreach loop tests - modifying the object during the loop.
+--FILE--
+<?php
+
+class C {
+ public $a = "Original a";
+ public $b = "Original b";
+ public $c = "Original c";
+ protected $d = "Original d";
+ private $e = "Original e";
+}
+
+echo "\nDirectly changing object values.\n";
+$obj = new C;
+foreach ($obj as $k=>$v) {
+ $obj->$k="changed.$k";
+ var_dump($v);
+}
+var_dump($obj);
+
+echo "\nModifying the foreach \$value.\n";
+$obj = new C;
+foreach ($obj as $k=>$v) {
+ $v="changed.$k";
+}
+var_dump($obj);
+
+
+echo "\nModifying the foreach &\$value.\n";
+$obj = new C;
+foreach ($obj as $k=>&$v) {
+ $v="changed.$k";
+}
+var_dump($obj);
+
+echo "\nAdding properties to an an object.\n";
+$obj = new C;
+$counter=0;
+foreach ($obj as $v) {
+ $newPropName = "new$counter";
+ $obj->$newPropName = "Added property $counter";
+ if ($counter++>10) {
+ echo "Loop detected\n";
+ break;
+ }
+ var_dump($v);
+}
+var_dump($obj);
+
+echo "\nAdding properties to an an object, using &\$value.\n";
+$obj = new C;
+$counter=0;
+foreach ($obj as &$v) {
+ $newPropName = "new$counter";
+ $obj->$newPropName = "Added property $counter";
+ if ($counter++>10) {
+ echo "Loop detected\n";
+ break;
+ }
+ var_dump($v);
+}
+var_dump($obj);
+
+echo "\nRemoving properties from an object.\n";
+$obj = new C;
+foreach ($obj as $v) {
+ unset($obj->a);
+ unset($obj->b);
+ unset($obj->c);
+ var_dump($v);
+}
+var_dump($obj);
+
+echo "\nRemoving properties from an object, using &\$value.\n";
+$obj = new C;
+foreach ($obj as &$v) {
+ unset($obj->a);
+ unset($obj->b);
+ unset($obj->c);
+ var_dump($v);
+}
+var_dump($obj);
+
+?>
+===DONE===
+--EXPECTF--
+Directly changing object values.
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ string(9) "changed.c"
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+Modifying the foreach $value.
+object(C)#%d (5) {
+ ["a"]=>
+ string(10) "Original a"
+ ["b"]=>
+ string(10) "Original b"
+ ["c"]=>
+ string(10) "Original c"
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+Modifying the foreach &$value.
+object(C)#%d (5) {
+ ["a"]=>
+ string(9) "changed.a"
+ ["b"]=>
+ string(9) "changed.b"
+ ["c"]=>
+ &string(9) "changed.c"
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+Adding properties to an an object.
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(16) "Added property 0"
+string(16) "Added property 1"
+string(16) "Added property 2"
+string(16) "Added property 3"
+string(16) "Added property 4"
+string(16) "Added property 5"
+string(16) "Added property 6"
+string(16) "Added property 7"
+Loop detected
+object(C)#%d (17) {
+ ["a"]=>
+ string(10) "Original a"
+ ["b"]=>
+ string(10) "Original b"
+ ["c"]=>
+ string(10) "Original c"
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+ ["new0"]=>
+ string(16) "Added property 0"
+ ["new1"]=>
+ string(16) "Added property 1"
+ ["new2"]=>
+ string(16) "Added property 2"
+ ["new3"]=>
+ string(16) "Added property 3"
+ ["new4"]=>
+ string(16) "Added property 4"
+ ["new5"]=>
+ string(16) "Added property 5"
+ ["new6"]=>
+ string(16) "Added property 6"
+ ["new7"]=>
+ string(16) "Added property 7"
+ ["new8"]=>
+ string(16) "Added property 8"
+ ["new9"]=>
+ string(16) "Added property 9"
+ ["new10"]=>
+ string(17) "Added property 10"
+ ["new11"]=>
+ string(17) "Added property 11"
+}
+
+Adding properties to an an object, using &$value.
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(16) "Added property 0"
+string(16) "Added property 1"
+string(16) "Added property 2"
+string(16) "Added property 3"
+string(16) "Added property 4"
+string(16) "Added property 5"
+string(16) "Added property 6"
+string(16) "Added property 7"
+Loop detected
+object(C)#%d (17) {
+ ["a"]=>
+ string(10) "Original a"
+ ["b"]=>
+ string(10) "Original b"
+ ["c"]=>
+ string(10) "Original c"
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+ ["new0"]=>
+ string(16) "Added property 0"
+ ["new1"]=>
+ string(16) "Added property 1"
+ ["new2"]=>
+ string(16) "Added property 2"
+ ["new3"]=>
+ string(16) "Added property 3"
+ ["new4"]=>
+ string(16) "Added property 4"
+ ["new5"]=>
+ string(16) "Added property 5"
+ ["new6"]=>
+ string(16) "Added property 6"
+ ["new7"]=>
+ string(16) "Added property 7"
+ ["new8"]=>
+ &string(16) "Added property 8"
+ ["new9"]=>
+ string(16) "Added property 9"
+ ["new10"]=>
+ string(17) "Added property 10"
+ ["new11"]=>
+ string(17) "Added property 11"
+}
+
+Removing properties from an object.
+string(10) "Original a"
+object(C)#%d (2) {
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+
+Removing properties from an object, using &$value.
+string(10) "Original a"
+object(C)#%d (2) {
+ ["d":protected]=>
+ string(10) "Original d"
+ ["e":"C":private]=>
+ string(10) "Original e"
+}
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/foreachLoopObjects.004.phpt b/tests/lang/foreachLoopObjects.004.phpt
new file mode 100644
index 0000000..a158ac6
--- /dev/null
+++ b/tests/lang/foreachLoopObjects.004.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Foreach loop tests - Removing the current element from an iterated object.
+--FILE--
+<?php
+
+class C {
+ public $a = "Original a";
+ public $b = "Original b";
+ public $c = "Original c";
+ public $d = "Original d";
+ public $e = "Original e";
+}
+
+echo "\nRemoving the current element from an iterated object.\n";
+$obj = new C;
+$count=0;
+foreach ($obj as $v) {
+ if ($v==$obj->b) {
+ unset($obj->b);
+ }
+ var_dump($v);
+ if (++$count>10) {
+ echo "Loop detected.\n";
+ break;
+ }
+}
+var_dump($obj);
+
+
+?>
+===DONE===
+--EXPECTF--
+Removing the current element from an iterated object.
+string(10) "Original a"
+string(10) "Original b"
+
+Notice: Undefined property: C::$b in %s on line %d
+string(10) "Original c"
+
+Notice: Undefined property: C::$b in %s on line %d
+string(10) "Original d"
+
+Notice: Undefined property: C::$b in %s on line %d
+string(10) "Original e"
+object(C)#%d (4) {
+ ["a"]=>
+ string(10) "Original a"
+ ["c"]=>
+ string(10) "Original c"
+ ["d"]=>
+ string(10) "Original d"
+ ["e"]=>
+ string(10) "Original e"
+}
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/foreachLoopObjects.005.phpt b/tests/lang/foreachLoopObjects.005.phpt
new file mode 100644
index 0000000..1692bcd
--- /dev/null
+++ b/tests/lang/foreachLoopObjects.005.phpt
@@ -0,0 +1,78 @@
+--TEST--
+Foreach loop tests - removing properties before and after the current property during the loop.
+--FILE--
+<?php
+
+class C {
+ public $a = "Original a";
+ public $b = "Original b";
+ public $c = "Original c";
+ public $d = "Original d";
+ public $e = "Original e";
+}
+
+echo "\nRemoving properties before the current element from an iterated object.\n";
+$obj = new C;
+$count=0;
+foreach ($obj as $v) {
+ if ($v==$obj->a) {
+ unset($obj->c);
+ }
+ var_dump($v);
+ if (++$count>10) {
+ echo "Loop detected.\n";
+ break;
+ }
+}
+var_dump($obj);
+
+echo "\nRemoving properties before the current element from an iterated object.\n";
+$obj = new C;
+foreach ($obj as $v) {
+ if ($v==$obj->b) {
+ unset($obj->a);
+ }
+ var_dump($v);
+ if (++$count>10) {
+ echo "Loop detected.\n";
+ break;
+ }
+}
+var_dump($obj);
+
+
+?>
+--EXPECTF--
+
+Removing properties before the current element from an iterated object.
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original d"
+string(10) "Original e"
+object(C)#%d (4) {
+ ["a"]=>
+ string(10) "Original a"
+ ["b"]=>
+ string(10) "Original b"
+ ["d"]=>
+ string(10) "Original d"
+ ["e"]=>
+ string(10) "Original e"
+}
+
+Removing properties before the current element from an iterated object.
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+string(10) "Original e"
+object(C)#%d (4) {
+ ["b"]=>
+ string(10) "Original b"
+ ["c"]=>
+ string(10) "Original c"
+ ["d"]=>
+ string(10) "Original d"
+ ["e"]=>
+ string(10) "Original e"
+}
diff --git a/tests/lang/foreachLoopObjects.006.phpt b/tests/lang/foreachLoopObjects.006.phpt
new file mode 100644
index 0000000..8218b44
--- /dev/null
+++ b/tests/lang/foreachLoopObjects.006.phpt
@@ -0,0 +1,147 @@
+--TEST--
+Foreach loop tests - substituting the entire iterated entity during the loop.
+--FILE--
+<?php
+
+class C {
+ public $a = "Original a";
+ public $b = "Original b";
+ public $c = "Original c";
+ public $d = "Original d";
+ public $e = "Original e";
+}
+
+echo "\nSubstituting the iterated object for a different object.\n";
+$obj = new C;
+$obj2 = new stdclass;
+$obj2->a = "new a";
+$obj2->b = "new b";
+$obj2->c = "new c";
+$obj2->d = "new d";
+$obj2->e = "new e";
+$obj2->f = "new f";
+$ref = &$obj;
+$count=0;
+foreach ($obj as $v) {
+ var_dump($v);
+ if ($v==$obj->b) {
+ $ref=$obj2;
+ }
+ if (++$count>10) {
+ echo "Loop detected.\n";
+ break;
+ }
+}
+var_dump($obj);
+
+echo "\nSubstituting the iterated object for an array.\n";
+$obj = new C;
+$a = array(1,2,3,4,5,6,7,8);
+$ref = &$obj;
+$count=0;
+foreach ($obj as $v) {
+ var_dump($v);
+ if ($v==="Original b") {
+ $ref=$a;
+ }
+ if (++$count>10) {
+ echo "Loop detected.\n";
+ break;
+ }
+}
+var_dump($obj);
+
+echo "\nSubstituting the iterated array for an object.\n";
+$a = array(1,2,3,4,5,6,7,8);
+$obj = new C;
+$ref = &$a;
+$count=0;
+foreach ($a as $v) {
+ var_dump($v);
+ if ($v===2) {
+ $ref=$obj;
+ }
+ if (++$count>10) {
+ echo "Loop detected.\n";
+ break;
+ }
+}
+var_dump($obj);
+
+?>
+--EXPECTF--
+
+Substituting the iterated object for a different object.
+string(10) "Original a"
+string(10) "Original b"
+string(5) "new a"
+string(5) "new b"
+string(5) "new c"
+string(5) "new d"
+string(5) "new e"
+string(5) "new f"
+object(stdClass)#%d (6) {
+ ["a"]=>
+ string(5) "new a"
+ ["b"]=>
+ string(5) "new b"
+ ["c"]=>
+ string(5) "new c"
+ ["d"]=>
+ string(5) "new d"
+ ["e"]=>
+ string(5) "new e"
+ ["f"]=>
+ string(5) "new f"
+}
+
+Substituting the iterated object for an array.
+string(10) "Original a"
+string(10) "Original b"
+int(1)
+int(2)
+int(3)
+int(4)
+int(5)
+int(6)
+int(7)
+int(8)
+array(8) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ [3]=>
+ int(4)
+ [4]=>
+ int(5)
+ [5]=>
+ int(6)
+ [6]=>
+ int(7)
+ [7]=>
+ int(8)
+}
+
+Substituting the iterated array for an object.
+int(1)
+int(2)
+string(10) "Original a"
+string(10) "Original b"
+string(10) "Original c"
+string(10) "Original d"
+string(10) "Original e"
+object(C)#%d (5) {
+ ["a"]=>
+ string(10) "Original a"
+ ["b"]=>
+ string(10) "Original b"
+ ["c"]=>
+ string(10) "Original c"
+ ["d"]=>
+ string(10) "Original d"
+ ["e"]=>
+ string(10) "Original e"
+}
diff --git a/tests/lang/foreach_with_object_001.phpt b/tests/lang/foreach_with_object_001.phpt
new file mode 100644
index 0000000..598b844
--- /dev/null
+++ b/tests/lang/foreach_with_object_001.phpt
@@ -0,0 +1,25 @@
+--TEST--
+foreach() with foreach($o->mthd()->arr)
+--FILE--
+<?php
+class Test {
+ public $a = array(1,2,3,4,5); // removed, crash too
+ function c() {
+ return new Test();
+ }
+
+}
+$obj = new Test();
+foreach ($obj->c()->a as $value) {
+ print "$value\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+1
+2
+3
+4
+5
+===DONE===
diff --git a/tests/lang/foreach_with_references_001.phpt b/tests/lang/foreach_with_references_001.phpt
new file mode 100644
index 0000000..eb52bb8
--- /dev/null
+++ b/tests/lang/foreach_with_references_001.phpt
@@ -0,0 +1,32 @@
+--TEST--
+foreach() with references
+--FILE--
+<?php
+
+$arr = array(1 => "one", 2 => "two", 3 => "three");
+
+foreach($arr as $key => $val) {
+ $val = $key;
+}
+
+print_r($arr);
+
+foreach($arr as $key => &$val) {
+ $val = $key;
+}
+
+print_r($arr);
+
+--EXPECT--
+Array
+(
+ [1] => one
+ [2] => two
+ [3] => three
+)
+Array
+(
+ [1] => 1
+ [2] => 2
+ [3] => 3
+)
diff --git a/tests/lang/func_get_arg.001.phpt b/tests/lang/func_get_arg.001.phpt
new file mode 100644
index 0000000..b1bbb18
--- /dev/null
+++ b/tests/lang/func_get_arg.001.phpt
@@ -0,0 +1,15 @@
+--TEST--
+func_get_arg test
+--FILE--
+<?php
+
+function foo($a)
+{
+ $a=5;
+ echo func_get_arg(0);
+}
+foo(2);
+echo "\n";
+?>
+--EXPECT--
+2 \ No newline at end of file
diff --git a/tests/lang/func_get_arg.002.phpt b/tests/lang/func_get_arg.002.phpt
new file mode 100644
index 0000000..6ab4f95
--- /dev/null
+++ b/tests/lang/func_get_arg.002.phpt
@@ -0,0 +1,19 @@
+--TEST--
+func_get_arg with variable number of args
+--FILE--
+<?php
+
+function foo($a)
+{
+ $b = func_get_arg(1);
+ var_dump($b);
+ $b++;
+ var_dump(func_get_arg(1));
+
+}
+foo(2, 3);
+echo "\n";
+?>
+--EXPECT--
+int(3)
+int(3)
diff --git a/tests/lang/func_get_arg.003.phpt b/tests/lang/func_get_arg.003.phpt
new file mode 100644
index 0000000..4ef9967
--- /dev/null
+++ b/tests/lang/func_get_arg.003.phpt
@@ -0,0 +1,11 @@
+--TEST--
+func_get_arg outside of a function declaration
+--FILE--
+<?php
+
+var_dump (func_get_arg(0));
+
+?>
+--EXPECTF--
+Warning: func_get_arg(): Called from the global scope - no function context in %s on line %d
+bool(false)
diff --git a/tests/lang/func_get_arg.004.phpt b/tests/lang/func_get_arg.004.phpt
new file mode 100644
index 0000000..6931df0
--- /dev/null
+++ b/tests/lang/func_get_arg.004.phpt
@@ -0,0 +1,16 @@
+--TEST--
+func_get_arg on non-existent arg
+--FILE--
+<?php
+
+function foo($a)
+{
+ var_dump(func_get_arg(2));
+}
+foo(2, 3);
+echo "\n";
+
+?>
+--EXPECTF--
+Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
+bool(false) \ No newline at end of file
diff --git a/tests/lang/func_get_arg.005.phpt b/tests/lang/func_get_arg.005.phpt
new file mode 100644
index 0000000..e1ae78e
--- /dev/null
+++ b/tests/lang/func_get_arg.005.phpt
@@ -0,0 +1,19 @@
+--TEST--
+A variable, which is referenced by another variable, is passed by value.
+During the call, the original variable is updated. This should not affect func_get_arg().
+--FILE--
+<?php
+function refVal($x) {
+ global $a;
+ $a = 'changed.a';
+ var_dump($x);
+ var_dump(func_get_arg(0));
+}
+
+$a = "original.a";
+$ref =& $a;
+refVal($a);
+?>
+--EXPECTF--
+string(10) "original.a"
+string(10) "original.a" \ No newline at end of file
diff --git a/tests/lang/func_get_arg_variation.phpt b/tests/lang/func_get_arg_variation.phpt
new file mode 100644
index 0000000..5dd0ed6
--- /dev/null
+++ b/tests/lang/func_get_arg_variation.phpt
@@ -0,0 +1,28 @@
+--TEST--
+func_get_arg test
+--FILE--
+<?php
+
+function foo($a)
+{
+ $a=5;
+ echo func_get_arg();
+ echo func_get_arg(2,2);
+ echo func_get_arg("hello");
+ echo func_get_arg(-1);
+ echo func_get_arg(2);
+}
+foo(2);
+echo "\n";
+?>
+--EXPECTF--
+Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d
+
+Warning: func_get_arg() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: func_get_arg() expects parameter 1 to be long, string given in %s on line %d
+
+Warning: func_get_arg(): The argument number should be >= 0 in %s on line %d
+
+Warning: func_get_arg(): Argument 2 not passed to function in %s on line %d
+
diff --git a/tests/lang/func_get_args.001.phpt b/tests/lang/func_get_args.001.phpt
new file mode 100644
index 0000000..740a0a2
--- /dev/null
+++ b/tests/lang/func_get_args.001.phpt
@@ -0,0 +1,15 @@
+--TEST--
+func_get_args with no args
+--FILE--
+<?php
+
+function foo()
+{
+ var_dump(func_get_args());
+}
+foo();
+
+?>
+--EXPECT--
+array(0) {
+} \ No newline at end of file
diff --git a/tests/lang/func_get_args.002.phpt b/tests/lang/func_get_args.002.phpt
new file mode 100644
index 0000000..0a886c2
--- /dev/null
+++ b/tests/lang/func_get_args.002.phpt
@@ -0,0 +1,22 @@
+--TEST--
+func_get_args with variable number of args
+--FILE--
+<?php
+
+function foo($a)
+{
+ var_dump(func_get_args());
+}
+foo(1, 2, 3);
+
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+
diff --git a/tests/lang/func_get_args.003.phpt b/tests/lang/func_get_args.003.phpt
new file mode 100644
index 0000000..44faf7e
--- /dev/null
+++ b/tests/lang/func_get_args.003.phpt
@@ -0,0 +1,11 @@
+--TEST--
+func_get_args() outside of a function declaration
+--FILE--
+<?php
+
+var_dump(func_get_args());
+
+?>
+--EXPECTREGEX--
+Warning\: func_get_args\(\)\: Called from the global scope - no function context in \S* on line 3
+bool\(false\)
diff --git a/tests/lang/func_get_args.004.phpt b/tests/lang/func_get_args.004.phpt
new file mode 100644
index 0000000..84e3ebe
--- /dev/null
+++ b/tests/lang/func_get_args.004.phpt
@@ -0,0 +1,67 @@
+--TEST--
+Pass same variable by ref and by value.
+--FILE--
+<?php
+function valRef($x, &$y) {
+ var_dump($x, $y);
+ var_dump(func_get_args());
+ $x = 'changed.x';
+ $y = 'changed.y';
+ var_dump(func_get_args());
+}
+
+function refVal(&$x, $y) {
+ var_dump($x, $y);
+ var_dump(func_get_args());
+ $x = 'changed.x';
+ $y = 'changed.y';
+ var_dump(func_get_args());
+}
+
+
+echo "\n\n-- Val, Ref --\n";
+$a = 'original.a';
+valRef($a, $a);
+var_dump($a);
+
+echo "\n\n-- Ref, Val --\n";
+$b = 'original.b';
+refVal($b, $b);
+var_dump($b);
+?>
+--EXPECTF--
+
+-- Val, Ref --
+string(10) "original.a"
+string(10) "original.a"
+array(2) {
+ [0]=>
+ string(10) "original.a"
+ [1]=>
+ string(10) "original.a"
+}
+array(2) {
+ [0]=>
+ string(10) "original.a"
+ [1]=>
+ string(9) "changed.y"
+}
+string(9) "changed.y"
+
+
+-- Ref, Val --
+string(10) "original.b"
+string(10) "original.b"
+array(2) {
+ [0]=>
+ string(10) "original.b"
+ [1]=>
+ string(10) "original.b"
+}
+array(2) {
+ [0]=>
+ string(9) "changed.x"
+ [1]=>
+ string(10) "original.b"
+}
+string(9) "changed.x" \ No newline at end of file
diff --git a/tests/lang/func_num_args.001.phpt b/tests/lang/func_num_args.001.phpt
new file mode 100644
index 0000000..c281557
--- /dev/null
+++ b/tests/lang/func_num_args.001.phpt
@@ -0,0 +1,14 @@
+--TEST--
+func_num_args with no args
+--FILE--
+<?php
+
+function foo()
+{
+ var_dump(func_num_args());
+}
+foo();
+
+?>
+--EXPECT--
+int(0) \ No newline at end of file
diff --git a/tests/lang/func_num_args.002.phpt b/tests/lang/func_num_args.002.phpt
new file mode 100644
index 0000000..bfb8f7c
--- /dev/null
+++ b/tests/lang/func_num_args.002.phpt
@@ -0,0 +1,14 @@
+--TEST--
+func_num_args with variable number of args
+--FILE--
+<?php
+
+function foo($a)
+{
+ var_dump(func_num_args());
+}
+foo(1, 2, 3);
+
+?>
+--EXPECT--
+int(3) \ No newline at end of file
diff --git a/tests/lang/func_num_args.003.phpt b/tests/lang/func_num_args.003.phpt
new file mode 100644
index 0000000..7cf1229
--- /dev/null
+++ b/tests/lang/func_num_args.003.phpt
@@ -0,0 +1,12 @@
+--TEST--
+func_num_args() outside of a function declaration
+--FILE--
+<?php
+
+var_dump(func_num_args());
+
+?>
+--EXPECTF--
+
+Warning: func_num_args(): Called from the global scope - no function context in %s on line %d
+int(-1) \ No newline at end of file
diff --git a/tests/lang/func_num_args.004.phpt b/tests/lang/func_num_args.004.phpt
new file mode 100644
index 0000000..8bdc6f0
--- /dev/null
+++ b/tests/lang/func_num_args.004.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Pass same variable by ref and by value.
+--FILE--
+<?php
+function valRef($x, &$y) {
+ var_dump($x, $y);
+ var_dump(func_num_args());
+ $x = 'changed.x';
+ $y = 'changed.y';
+ var_dump(func_num_args());
+}
+
+function refVal(&$x, $y) {
+ var_dump($x, $y);
+ var_dump(func_num_args());
+ $x = 'changed.x';
+ $y = 'changed.y';
+ var_dump(func_num_args());
+}
+
+
+echo "\n\n-- Val, Ref --\n";
+$a = 'original.a';
+valRef($a, $a);
+var_dump($a);
+
+echo "\n\n-- Ref, Val --\n";
+$b = 'original.b';
+refVal($b, $b);
+var_dump($b);
+?>
+--EXPECTF--
+
+
+-- Val, Ref --
+string(10) "original.a"
+string(10) "original.a"
+int(2)
+int(2)
+string(9) "changed.y"
+
+
+-- Ref, Val --
+string(10) "original.b"
+string(10) "original.b"
+int(2)
+int(2)
+string(9) "changed.x"
diff --git a/tests/lang/inc.inc b/tests/lang/inc.inc
new file mode 100644
index 0000000..64b30af
--- /dev/null
+++ b/tests/lang/inc.inc
@@ -0,0 +1,3 @@
+<?php
+echo "Included!\n";
+?>
diff --git a/tests/lang/inc_throw.inc b/tests/lang/inc_throw.inc
new file mode 100644
index 0000000..1f032f7
--- /dev/null
+++ b/tests/lang/inc_throw.inc
@@ -0,0 +1,5 @@
+<?php
+
+throw new Exception();
+
+?>
diff --git a/tests/lang/include_files/echo.inc b/tests/lang/include_files/echo.inc
new file mode 100644
index 0000000..60714f6
--- /dev/null
+++ b/tests/lang/include_files/echo.inc
@@ -0,0 +1,3 @@
+<?php
+echo "Included!\n";
+?> \ No newline at end of file
diff --git a/tests/lang/include_files/eval.inc b/tests/lang/include_files/eval.inc
new file mode 100644
index 0000000..16da862
--- /dev/null
+++ b/tests/lang/include_files/eval.inc
@@ -0,0 +1,3 @@
+<?php
+eval("require_once 'echo.inc';");
+?> \ No newline at end of file
diff --git a/tests/lang/include_files/function.inc b/tests/lang/include_files/function.inc
new file mode 100644
index 0000000..528f46c
--- /dev/null
+++ b/tests/lang/include_files/function.inc
@@ -0,0 +1,3 @@
+<?php
+function test() { require_once 'echo.inc'; }
+?>
diff --git a/tests/lang/include_variation1.phpt b/tests/lang/include_variation1.phpt
new file mode 100644
index 0000000..cf99ba9
--- /dev/null
+++ b/tests/lang/include_variation1.phpt
@@ -0,0 +1,8 @@
+--TEST--
+include() a file from the current script directory
+--FILE--
+<?php
+include("inc.inc");
+?>
+--EXPECT--
+Included!
diff --git a/tests/lang/include_variation2.phpt b/tests/lang/include_variation2.phpt
new file mode 100644
index 0000000..051ed71
--- /dev/null
+++ b/tests/lang/include_variation2.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Including a file in the current script directory from an included function
+--FILE--
+<?php
+require_once 'include_files/function.inc';
+test();
+?>
+--EXPECT--
+Included!
diff --git a/tests/lang/include_variation3.phpt b/tests/lang/include_variation3.phpt
new file mode 100644
index 0000000..1fa80c5
--- /dev/null
+++ b/tests/lang/include_variation3.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Including a file in the current script directory from eval'd code
+--FILE--
+<?php
+require_once 'include_files/eval.inc';
+?>
+--EXPECT--
+Included! \ No newline at end of file
diff --git a/tests/lang/operators/add_basiclong_64bit.phpt b/tests/lang/operators/add_basiclong_64bit.phpt
new file mode 100644
index 0000000..cae8f4f
--- /dev/null
+++ b/tests/lang/operators/add_basiclong_64bit.phpt
@@ -0,0 +1,582 @@
+--TEST--
+Test + operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal + $otherVal ---\n";
+ var_dump($longVal+$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal + $longVal ---\n";
+ var_dump($otherVal+$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 + 0 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 + 1 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775807 + -1 ---
+int(9223372036854775806)
+--- testing: 9223372036854775807 + 7 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775807 + 9 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775807 + 65 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775807 + -44 ---
+int(9223372036854775763)
+--- testing: 9223372036854775807 + 2147483647 ---
+float(9.2233720390023E+18)
+--- testing: 9223372036854775807 + 9223372036854775807 ---
+float(1.844674407371E+19)
+--- testing: -9223372036854775808 + 0 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 + 1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775808 + -1 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775808 + 7 ---
+int(-9223372036854775801)
+--- testing: -9223372036854775808 + 9 ---
+int(-9223372036854775799)
+--- testing: -9223372036854775808 + 65 ---
+int(-9223372036854775743)
+--- testing: -9223372036854775808 + -44 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775808 + 2147483647 ---
+int(-9223372034707292161)
+--- testing: -9223372036854775808 + 9223372036854775807 ---
+int(-1)
+--- testing: 2147483647 + 0 ---
+int(2147483647)
+--- testing: 2147483647 + 1 ---
+int(2147483648)
+--- testing: 2147483647 + -1 ---
+int(2147483646)
+--- testing: 2147483647 + 7 ---
+int(2147483654)
+--- testing: 2147483647 + 9 ---
+int(2147483656)
+--- testing: 2147483647 + 65 ---
+int(2147483712)
+--- testing: 2147483647 + -44 ---
+int(2147483603)
+--- testing: 2147483647 + 2147483647 ---
+int(4294967294)
+--- testing: 2147483647 + 9223372036854775807 ---
+float(9.2233720390023E+18)
+--- testing: -2147483648 + 0 ---
+int(-2147483648)
+--- testing: -2147483648 + 1 ---
+int(-2147483647)
+--- testing: -2147483648 + -1 ---
+int(-2147483649)
+--- testing: -2147483648 + 7 ---
+int(-2147483641)
+--- testing: -2147483648 + 9 ---
+int(-2147483639)
+--- testing: -2147483648 + 65 ---
+int(-2147483583)
+--- testing: -2147483648 + -44 ---
+int(-2147483692)
+--- testing: -2147483648 + 2147483647 ---
+int(-1)
+--- testing: -2147483648 + 9223372036854775807 ---
+int(9223372034707292159)
+--- testing: 9223372034707292160 + 0 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 + 1 ---
+int(9223372034707292161)
+--- testing: 9223372034707292160 + -1 ---
+int(9223372034707292159)
+--- testing: 9223372034707292160 + 7 ---
+int(9223372034707292167)
+--- testing: 9223372034707292160 + 9 ---
+int(9223372034707292169)
+--- testing: 9223372034707292160 + 65 ---
+int(9223372034707292225)
+--- testing: 9223372034707292160 + -44 ---
+int(9223372034707292116)
+--- testing: 9223372034707292160 + 2147483647 ---
+int(9223372036854775807)
+--- testing: 9223372034707292160 + 9223372036854775807 ---
+float(1.8446744071562E+19)
+--- testing: -9223372034707292160 + 0 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 + 1 ---
+int(-9223372034707292159)
+--- testing: -9223372034707292160 + -1 ---
+int(-9223372034707292161)
+--- testing: -9223372034707292160 + 7 ---
+int(-9223372034707292153)
+--- testing: -9223372034707292160 + 9 ---
+int(-9223372034707292151)
+--- testing: -9223372034707292160 + 65 ---
+int(-9223372034707292095)
+--- testing: -9223372034707292160 + -44 ---
+int(-9223372034707292204)
+--- testing: -9223372034707292160 + 2147483647 ---
+int(-9223372032559808513)
+--- testing: -9223372034707292160 + 9223372036854775807 ---
+int(2147483647)
+--- testing: 2147483648 + 0 ---
+int(2147483648)
+--- testing: 2147483648 + 1 ---
+int(2147483649)
+--- testing: 2147483648 + -1 ---
+int(2147483647)
+--- testing: 2147483648 + 7 ---
+int(2147483655)
+--- testing: 2147483648 + 9 ---
+int(2147483657)
+--- testing: 2147483648 + 65 ---
+int(2147483713)
+--- testing: 2147483648 + -44 ---
+int(2147483604)
+--- testing: 2147483648 + 2147483647 ---
+int(4294967295)
+--- testing: 2147483648 + 9223372036854775807 ---
+float(9.2233720390023E+18)
+--- testing: -2147483649 + 0 ---
+int(-2147483649)
+--- testing: -2147483649 + 1 ---
+int(-2147483648)
+--- testing: -2147483649 + -1 ---
+int(-2147483650)
+--- testing: -2147483649 + 7 ---
+int(-2147483642)
+--- testing: -2147483649 + 9 ---
+int(-2147483640)
+--- testing: -2147483649 + 65 ---
+int(-2147483584)
+--- testing: -2147483649 + -44 ---
+int(-2147483693)
+--- testing: -2147483649 + 2147483647 ---
+int(-2)
+--- testing: -2147483649 + 9223372036854775807 ---
+int(9223372034707292158)
+--- testing: 4294967294 + 0 ---
+int(4294967294)
+--- testing: 4294967294 + 1 ---
+int(4294967295)
+--- testing: 4294967294 + -1 ---
+int(4294967293)
+--- testing: 4294967294 + 7 ---
+int(4294967301)
+--- testing: 4294967294 + 9 ---
+int(4294967303)
+--- testing: 4294967294 + 65 ---
+int(4294967359)
+--- testing: 4294967294 + -44 ---
+int(4294967250)
+--- testing: 4294967294 + 2147483647 ---
+int(6442450941)
+--- testing: 4294967294 + 9223372036854775807 ---
+float(9.2233720411497E+18)
+--- testing: 4294967295 + 0 ---
+int(4294967295)
+--- testing: 4294967295 + 1 ---
+int(4294967296)
+--- testing: 4294967295 + -1 ---
+int(4294967294)
+--- testing: 4294967295 + 7 ---
+int(4294967302)
+--- testing: 4294967295 + 9 ---
+int(4294967304)
+--- testing: 4294967295 + 65 ---
+int(4294967360)
+--- testing: 4294967295 + -44 ---
+int(4294967251)
+--- testing: 4294967295 + 2147483647 ---
+int(6442450942)
+--- testing: 4294967295 + 9223372036854775807 ---
+float(9.2233720411497E+18)
+--- testing: 4294967293 + 0 ---
+int(4294967293)
+--- testing: 4294967293 + 1 ---
+int(4294967294)
+--- testing: 4294967293 + -1 ---
+int(4294967292)
+--- testing: 4294967293 + 7 ---
+int(4294967300)
+--- testing: 4294967293 + 9 ---
+int(4294967302)
+--- testing: 4294967293 + 65 ---
+int(4294967358)
+--- testing: 4294967293 + -44 ---
+int(4294967249)
+--- testing: 4294967293 + 2147483647 ---
+int(6442450940)
+--- testing: 4294967293 + 9223372036854775807 ---
+float(9.2233720411497E+18)
+--- testing: 9223372036854775806 + 0 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 + 1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 + -1 ---
+int(9223372036854775805)
+--- testing: 9223372036854775806 + 7 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775806 + 9 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775806 + 65 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775806 + -44 ---
+int(9223372036854775762)
+--- testing: 9223372036854775806 + 2147483647 ---
+float(9.2233720390023E+18)
+--- testing: 9223372036854775806 + 9223372036854775807 ---
+float(1.844674407371E+19)
+--- testing: 9.2233720368548E+18 + 0 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 + 1 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 + -1 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 + 7 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 + 9 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 + 65 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 + -44 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 + 2147483647 ---
+float(9.2233720390023E+18)
+--- testing: 9.2233720368548E+18 + 9223372036854775807 ---
+float(1.844674407371E+19)
+--- testing: -9223372036854775807 + 0 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 + 1 ---
+int(-9223372036854775806)
+--- testing: -9223372036854775807 + -1 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775807 + 7 ---
+int(-9223372036854775800)
+--- testing: -9223372036854775807 + 9 ---
+int(-9223372036854775798)
+--- testing: -9223372036854775807 + 65 ---
+int(-9223372036854775742)
+--- testing: -9223372036854775807 + -44 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775807 + 2147483647 ---
+int(-9223372034707292160)
+--- testing: -9223372036854775807 + 9223372036854775807 ---
+int(0)
+--- testing: -9.2233720368548E+18 + 0 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 + 1 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 + -1 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 + 7 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 + 9 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 + 65 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 + -44 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 + 2147483647 ---
+float(-9.2233720347073E+18)
+--- testing: -9.2233720368548E+18 + 9223372036854775807 ---
+float(0)
+--- testing: 0 + 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 0 + -9223372036854775808 ---
+int(-9223372036854775808)
+--- testing: 0 + 2147483647 ---
+int(2147483647)
+--- testing: 0 + -2147483648 ---
+int(-2147483648)
+--- testing: 0 + 9223372034707292160 ---
+int(9223372034707292160)
+--- testing: 0 + -9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: 0 + 2147483648 ---
+int(2147483648)
+--- testing: 0 + -2147483649 ---
+int(-2147483649)
+--- testing: 0 + 4294967294 ---
+int(4294967294)
+--- testing: 0 + 4294967295 ---
+int(4294967295)
+--- testing: 0 + 4294967293 ---
+int(4294967293)
+--- testing: 0 + 9223372036854775806 ---
+int(9223372036854775806)
+--- testing: 0 + 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 0 + -9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: 0 + -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 1 + 9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 1 + -9223372036854775808 ---
+int(-9223372036854775807)
+--- testing: 1 + 2147483647 ---
+int(2147483648)
+--- testing: 1 + -2147483648 ---
+int(-2147483647)
+--- testing: 1 + 9223372034707292160 ---
+int(9223372034707292161)
+--- testing: 1 + -9223372034707292160 ---
+int(-9223372034707292159)
+--- testing: 1 + 2147483648 ---
+int(2147483649)
+--- testing: 1 + -2147483649 ---
+int(-2147483648)
+--- testing: 1 + 4294967294 ---
+int(4294967295)
+--- testing: 1 + 4294967295 ---
+int(4294967296)
+--- testing: 1 + 4294967293 ---
+int(4294967294)
+--- testing: 1 + 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 1 + 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 1 + -9223372036854775807 ---
+int(-9223372036854775806)
+--- testing: 1 + -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: -1 + 9223372036854775807 ---
+int(9223372036854775806)
+--- testing: -1 + -9223372036854775808 ---
+float(-9.2233720368548E+18)
+--- testing: -1 + 2147483647 ---
+int(2147483646)
+--- testing: -1 + -2147483648 ---
+int(-2147483649)
+--- testing: -1 + 9223372034707292160 ---
+int(9223372034707292159)
+--- testing: -1 + -9223372034707292160 ---
+int(-9223372034707292161)
+--- testing: -1 + 2147483648 ---
+int(2147483647)
+--- testing: -1 + -2147483649 ---
+int(-2147483650)
+--- testing: -1 + 4294967294 ---
+int(4294967293)
+--- testing: -1 + 4294967295 ---
+int(4294967294)
+--- testing: -1 + 4294967293 ---
+int(4294967292)
+--- testing: -1 + 9223372036854775806 ---
+int(9223372036854775805)
+--- testing: -1 + 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -1 + -9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -1 + -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 7 + 9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 7 + -9223372036854775808 ---
+int(-9223372036854775801)
+--- testing: 7 + 2147483647 ---
+int(2147483654)
+--- testing: 7 + -2147483648 ---
+int(-2147483641)
+--- testing: 7 + 9223372034707292160 ---
+int(9223372034707292167)
+--- testing: 7 + -9223372034707292160 ---
+int(-9223372034707292153)
+--- testing: 7 + 2147483648 ---
+int(2147483655)
+--- testing: 7 + -2147483649 ---
+int(-2147483642)
+--- testing: 7 + 4294967294 ---
+int(4294967301)
+--- testing: 7 + 4294967295 ---
+int(4294967302)
+--- testing: 7 + 4294967293 ---
+int(4294967300)
+--- testing: 7 + 9223372036854775806 ---
+float(9.2233720368548E+18)
+--- testing: 7 + 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 7 + -9223372036854775807 ---
+int(-9223372036854775800)
+--- testing: 7 + -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 9 + 9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 9 + -9223372036854775808 ---
+int(-9223372036854775799)
+--- testing: 9 + 2147483647 ---
+int(2147483656)
+--- testing: 9 + -2147483648 ---
+int(-2147483639)
+--- testing: 9 + 9223372034707292160 ---
+int(9223372034707292169)
+--- testing: 9 + -9223372034707292160 ---
+int(-9223372034707292151)
+--- testing: 9 + 2147483648 ---
+int(2147483657)
+--- testing: 9 + -2147483649 ---
+int(-2147483640)
+--- testing: 9 + 4294967294 ---
+int(4294967303)
+--- testing: 9 + 4294967295 ---
+int(4294967304)
+--- testing: 9 + 4294967293 ---
+int(4294967302)
+--- testing: 9 + 9223372036854775806 ---
+float(9.2233720368548E+18)
+--- testing: 9 + 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 9 + -9223372036854775807 ---
+int(-9223372036854775798)
+--- testing: 9 + -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 65 + 9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 65 + -9223372036854775808 ---
+int(-9223372036854775743)
+--- testing: 65 + 2147483647 ---
+int(2147483712)
+--- testing: 65 + -2147483648 ---
+int(-2147483583)
+--- testing: 65 + 9223372034707292160 ---
+int(9223372034707292225)
+--- testing: 65 + -9223372034707292160 ---
+int(-9223372034707292095)
+--- testing: 65 + 2147483648 ---
+int(2147483713)
+--- testing: 65 + -2147483649 ---
+int(-2147483584)
+--- testing: 65 + 4294967294 ---
+int(4294967359)
+--- testing: 65 + 4294967295 ---
+int(4294967360)
+--- testing: 65 + 4294967293 ---
+int(4294967358)
+--- testing: 65 + 9223372036854775806 ---
+float(9.2233720368548E+18)
+--- testing: 65 + 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 65 + -9223372036854775807 ---
+int(-9223372036854775742)
+--- testing: 65 + -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: -44 + 9223372036854775807 ---
+int(9223372036854775763)
+--- testing: -44 + -9223372036854775808 ---
+float(-9.2233720368548E+18)
+--- testing: -44 + 2147483647 ---
+int(2147483603)
+--- testing: -44 + -2147483648 ---
+int(-2147483692)
+--- testing: -44 + 9223372034707292160 ---
+int(9223372034707292116)
+--- testing: -44 + -9223372034707292160 ---
+int(-9223372034707292204)
+--- testing: -44 + 2147483648 ---
+int(2147483604)
+--- testing: -44 + -2147483649 ---
+int(-2147483693)
+--- testing: -44 + 4294967294 ---
+int(4294967250)
+--- testing: -44 + 4294967295 ---
+int(4294967251)
+--- testing: -44 + 4294967293 ---
+int(4294967249)
+--- testing: -44 + 9223372036854775806 ---
+int(9223372036854775762)
+--- testing: -44 + 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -44 + -9223372036854775807 ---
+float(-9.2233720368548E+18)
+--- testing: -44 + -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 2147483647 + 9223372036854775807 ---
+float(9.2233720390023E+18)
+--- testing: 2147483647 + -9223372036854775808 ---
+int(-9223372034707292161)
+--- testing: 2147483647 + 2147483647 ---
+int(4294967294)
+--- testing: 2147483647 + -2147483648 ---
+int(-1)
+--- testing: 2147483647 + 9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 2147483647 + -9223372034707292160 ---
+int(-9223372032559808513)
+--- testing: 2147483647 + 2147483648 ---
+int(4294967295)
+--- testing: 2147483647 + -2147483649 ---
+int(-2)
+--- testing: 2147483647 + 4294967294 ---
+int(6442450941)
+--- testing: 2147483647 + 4294967295 ---
+int(6442450942)
+--- testing: 2147483647 + 4294967293 ---
+int(6442450940)
+--- testing: 2147483647 + 9223372036854775806 ---
+float(9.2233720390023E+18)
+--- testing: 2147483647 + 9.2233720368548E+18 ---
+float(9.2233720390023E+18)
+--- testing: 2147483647 + -9223372036854775807 ---
+int(-9223372034707292160)
+--- testing: 2147483647 + -9.2233720368548E+18 ---
+float(-9.2233720347073E+18)
+--- testing: 9223372036854775807 + 9223372036854775807 ---
+float(1.844674407371E+19)
+--- testing: 9223372036854775807 + -9223372036854775808 ---
+int(-1)
+--- testing: 9223372036854775807 + 2147483647 ---
+float(9.2233720390023E+18)
+--- testing: 9223372036854775807 + -2147483648 ---
+int(9223372034707292159)
+--- testing: 9223372036854775807 + 9223372034707292160 ---
+float(1.8446744071562E+19)
+--- testing: 9223372036854775807 + -9223372034707292160 ---
+int(2147483647)
+--- testing: 9223372036854775807 + 2147483648 ---
+float(9.2233720390023E+18)
+--- testing: 9223372036854775807 + -2147483649 ---
+int(9223372034707292158)
+--- testing: 9223372036854775807 + 4294967294 ---
+float(9.2233720411497E+18)
+--- testing: 9223372036854775807 + 4294967295 ---
+float(9.2233720411497E+18)
+--- testing: 9223372036854775807 + 4294967293 ---
+float(9.2233720411497E+18)
+--- testing: 9223372036854775807 + 9223372036854775806 ---
+float(1.844674407371E+19)
+--- testing: 9223372036854775807 + 9.2233720368548E+18 ---
+float(1.844674407371E+19)
+--- testing: 9223372036854775807 + -9223372036854775807 ---
+int(0)
+--- testing: 9223372036854775807 + -9.2233720368548E+18 ---
+float(0)
+===DONE===
diff --git a/tests/lang/operators/add_variationStr.phpt b/tests/lang/operators/add_variationStr.phpt
new file mode 100644
index 0000000..264c5c1
--- /dev/null
+++ b/tests/lang/operators/add_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test + operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' + '$otherVal' ---\n";
+ var_dump($strVal+$otherVal);
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' + '0' ---
+int(0)
+--- testing: '0' + '65' ---
+int(65)
+--- testing: '0' + '-44' ---
+int(-44)
+--- testing: '0' + '1.2' ---
+float(1.2)
+--- testing: '0' + '-7.7' ---
+float(-7.7)
+--- testing: '0' + 'abc' ---
+int(0)
+--- testing: '0' + '123abc' ---
+int(123)
+--- testing: '0' + '123e5' ---
+float(12300000)
+--- testing: '0' + '123e5xyz' ---
+float(12300000)
+--- testing: '0' + ' 123abc' ---
+int(123)
+--- testing: '0' + '123 abc' ---
+int(123)
+--- testing: '0' + '123abc ' ---
+int(123)
+--- testing: '0' + '3.4a' ---
+float(3.4)
+--- testing: '0' + 'a5.9' ---
+int(0)
+--- testing: '65' + '0' ---
+int(65)
+--- testing: '65' + '65' ---
+int(130)
+--- testing: '65' + '-44' ---
+int(21)
+--- testing: '65' + '1.2' ---
+float(66.2)
+--- testing: '65' + '-7.7' ---
+float(57.3)
+--- testing: '65' + 'abc' ---
+int(65)
+--- testing: '65' + '123abc' ---
+int(188)
+--- testing: '65' + '123e5' ---
+float(12300065)
+--- testing: '65' + '123e5xyz' ---
+float(12300065)
+--- testing: '65' + ' 123abc' ---
+int(188)
+--- testing: '65' + '123 abc' ---
+int(188)
+--- testing: '65' + '123abc ' ---
+int(188)
+--- testing: '65' + '3.4a' ---
+float(68.4)
+--- testing: '65' + 'a5.9' ---
+int(65)
+--- testing: '-44' + '0' ---
+int(-44)
+--- testing: '-44' + '65' ---
+int(21)
+--- testing: '-44' + '-44' ---
+int(-88)
+--- testing: '-44' + '1.2' ---
+float(-42.8)
+--- testing: '-44' + '-7.7' ---
+float(-51.7)
+--- testing: '-44' + 'abc' ---
+int(-44)
+--- testing: '-44' + '123abc' ---
+int(79)
+--- testing: '-44' + '123e5' ---
+float(12299956)
+--- testing: '-44' + '123e5xyz' ---
+float(12299956)
+--- testing: '-44' + ' 123abc' ---
+int(79)
+--- testing: '-44' + '123 abc' ---
+int(79)
+--- testing: '-44' + '123abc ' ---
+int(79)
+--- testing: '-44' + '3.4a' ---
+float(-40.6)
+--- testing: '-44' + 'a5.9' ---
+int(-44)
+--- testing: '1.2' + '0' ---
+float(1.2)
+--- testing: '1.2' + '65' ---
+float(66.2)
+--- testing: '1.2' + '-44' ---
+float(-42.8)
+--- testing: '1.2' + '1.2' ---
+float(2.4)
+--- testing: '1.2' + '-7.7' ---
+float(-6.5)
+--- testing: '1.2' + 'abc' ---
+float(1.2)
+--- testing: '1.2' + '123abc' ---
+float(124.2)
+--- testing: '1.2' + '123e5' ---
+float(12300001.2)
+--- testing: '1.2' + '123e5xyz' ---
+float(12300001.2)
+--- testing: '1.2' + ' 123abc' ---
+float(124.2)
+--- testing: '1.2' + '123 abc' ---
+float(124.2)
+--- testing: '1.2' + '123abc ' ---
+float(124.2)
+--- testing: '1.2' + '3.4a' ---
+float(4.6)
+--- testing: '1.2' + 'a5.9' ---
+float(1.2)
+--- testing: '-7.7' + '0' ---
+float(-7.7)
+--- testing: '-7.7' + '65' ---
+float(57.3)
+--- testing: '-7.7' + '-44' ---
+float(-51.7)
+--- testing: '-7.7' + '1.2' ---
+float(-6.5)
+--- testing: '-7.7' + '-7.7' ---
+float(-15.4)
+--- testing: '-7.7' + 'abc' ---
+float(-7.7)
+--- testing: '-7.7' + '123abc' ---
+float(115.3)
+--- testing: '-7.7' + '123e5' ---
+float(12299992.3)
+--- testing: '-7.7' + '123e5xyz' ---
+float(12299992.3)
+--- testing: '-7.7' + ' 123abc' ---
+float(115.3)
+--- testing: '-7.7' + '123 abc' ---
+float(115.3)
+--- testing: '-7.7' + '123abc ' ---
+float(115.3)
+--- testing: '-7.7' + '3.4a' ---
+float(-4.3)
+--- testing: '-7.7' + 'a5.9' ---
+float(-7.7)
+--- testing: 'abc' + '0' ---
+int(0)
+--- testing: 'abc' + '65' ---
+int(65)
+--- testing: 'abc' + '-44' ---
+int(-44)
+--- testing: 'abc' + '1.2' ---
+float(1.2)
+--- testing: 'abc' + '-7.7' ---
+float(-7.7)
+--- testing: 'abc' + 'abc' ---
+int(0)
+--- testing: 'abc' + '123abc' ---
+int(123)
+--- testing: 'abc' + '123e5' ---
+float(12300000)
+--- testing: 'abc' + '123e5xyz' ---
+float(12300000)
+--- testing: 'abc' + ' 123abc' ---
+int(123)
+--- testing: 'abc' + '123 abc' ---
+int(123)
+--- testing: 'abc' + '123abc ' ---
+int(123)
+--- testing: 'abc' + '3.4a' ---
+float(3.4)
+--- testing: 'abc' + 'a5.9' ---
+int(0)
+--- testing: '123abc' + '0' ---
+int(123)
+--- testing: '123abc' + '65' ---
+int(188)
+--- testing: '123abc' + '-44' ---
+int(79)
+--- testing: '123abc' + '1.2' ---
+float(124.2)
+--- testing: '123abc' + '-7.7' ---
+float(115.3)
+--- testing: '123abc' + 'abc' ---
+int(123)
+--- testing: '123abc' + '123abc' ---
+int(246)
+--- testing: '123abc' + '123e5' ---
+float(12300123)
+--- testing: '123abc' + '123e5xyz' ---
+float(12300123)
+--- testing: '123abc' + ' 123abc' ---
+int(246)
+--- testing: '123abc' + '123 abc' ---
+int(246)
+--- testing: '123abc' + '123abc ' ---
+int(246)
+--- testing: '123abc' + '3.4a' ---
+float(126.4)
+--- testing: '123abc' + 'a5.9' ---
+int(123)
+--- testing: '123e5' + '0' ---
+float(12300000)
+--- testing: '123e5' + '65' ---
+float(12300065)
+--- testing: '123e5' + '-44' ---
+float(12299956)
+--- testing: '123e5' + '1.2' ---
+float(12300001.2)
+--- testing: '123e5' + '-7.7' ---
+float(12299992.3)
+--- testing: '123e5' + 'abc' ---
+float(12300000)
+--- testing: '123e5' + '123abc' ---
+float(12300123)
+--- testing: '123e5' + '123e5' ---
+float(24600000)
+--- testing: '123e5' + '123e5xyz' ---
+float(24600000)
+--- testing: '123e5' + ' 123abc' ---
+float(12300123)
+--- testing: '123e5' + '123 abc' ---
+float(12300123)
+--- testing: '123e5' + '123abc ' ---
+float(12300123)
+--- testing: '123e5' + '3.4a' ---
+float(12300003.4)
+--- testing: '123e5' + 'a5.9' ---
+float(12300000)
+--- testing: '123e5xyz' + '0' ---
+float(12300000)
+--- testing: '123e5xyz' + '65' ---
+float(12300065)
+--- testing: '123e5xyz' + '-44' ---
+float(12299956)
+--- testing: '123e5xyz' + '1.2' ---
+float(12300001.2)
+--- testing: '123e5xyz' + '-7.7' ---
+float(12299992.3)
+--- testing: '123e5xyz' + 'abc' ---
+float(12300000)
+--- testing: '123e5xyz' + '123abc' ---
+float(12300123)
+--- testing: '123e5xyz' + '123e5' ---
+float(24600000)
+--- testing: '123e5xyz' + '123e5xyz' ---
+float(24600000)
+--- testing: '123e5xyz' + ' 123abc' ---
+float(12300123)
+--- testing: '123e5xyz' + '123 abc' ---
+float(12300123)
+--- testing: '123e5xyz' + '123abc ' ---
+float(12300123)
+--- testing: '123e5xyz' + '3.4a' ---
+float(12300003.4)
+--- testing: '123e5xyz' + 'a5.9' ---
+float(12300000)
+--- testing: ' 123abc' + '0' ---
+int(123)
+--- testing: ' 123abc' + '65' ---
+int(188)
+--- testing: ' 123abc' + '-44' ---
+int(79)
+--- testing: ' 123abc' + '1.2' ---
+float(124.2)
+--- testing: ' 123abc' + '-7.7' ---
+float(115.3)
+--- testing: ' 123abc' + 'abc' ---
+int(123)
+--- testing: ' 123abc' + '123abc' ---
+int(246)
+--- testing: ' 123abc' + '123e5' ---
+float(12300123)
+--- testing: ' 123abc' + '123e5xyz' ---
+float(12300123)
+--- testing: ' 123abc' + ' 123abc' ---
+int(246)
+--- testing: ' 123abc' + '123 abc' ---
+int(246)
+--- testing: ' 123abc' + '123abc ' ---
+int(246)
+--- testing: ' 123abc' + '3.4a' ---
+float(126.4)
+--- testing: ' 123abc' + 'a5.9' ---
+int(123)
+--- testing: '123 abc' + '0' ---
+int(123)
+--- testing: '123 abc' + '65' ---
+int(188)
+--- testing: '123 abc' + '-44' ---
+int(79)
+--- testing: '123 abc' + '1.2' ---
+float(124.2)
+--- testing: '123 abc' + '-7.7' ---
+float(115.3)
+--- testing: '123 abc' + 'abc' ---
+int(123)
+--- testing: '123 abc' + '123abc' ---
+int(246)
+--- testing: '123 abc' + '123e5' ---
+float(12300123)
+--- testing: '123 abc' + '123e5xyz' ---
+float(12300123)
+--- testing: '123 abc' + ' 123abc' ---
+int(246)
+--- testing: '123 abc' + '123 abc' ---
+int(246)
+--- testing: '123 abc' + '123abc ' ---
+int(246)
+--- testing: '123 abc' + '3.4a' ---
+float(126.4)
+--- testing: '123 abc' + 'a5.9' ---
+int(123)
+--- testing: '123abc ' + '0' ---
+int(123)
+--- testing: '123abc ' + '65' ---
+int(188)
+--- testing: '123abc ' + '-44' ---
+int(79)
+--- testing: '123abc ' + '1.2' ---
+float(124.2)
+--- testing: '123abc ' + '-7.7' ---
+float(115.3)
+--- testing: '123abc ' + 'abc' ---
+int(123)
+--- testing: '123abc ' + '123abc' ---
+int(246)
+--- testing: '123abc ' + '123e5' ---
+float(12300123)
+--- testing: '123abc ' + '123e5xyz' ---
+float(12300123)
+--- testing: '123abc ' + ' 123abc' ---
+int(246)
+--- testing: '123abc ' + '123 abc' ---
+int(246)
+--- testing: '123abc ' + '123abc ' ---
+int(246)
+--- testing: '123abc ' + '3.4a' ---
+float(126.4)
+--- testing: '123abc ' + 'a5.9' ---
+int(123)
+--- testing: '3.4a' + '0' ---
+float(3.4)
+--- testing: '3.4a' + '65' ---
+float(68.4)
+--- testing: '3.4a' + '-44' ---
+float(-40.6)
+--- testing: '3.4a' + '1.2' ---
+float(4.6)
+--- testing: '3.4a' + '-7.7' ---
+float(-4.3)
+--- testing: '3.4a' + 'abc' ---
+float(3.4)
+--- testing: '3.4a' + '123abc' ---
+float(126.4)
+--- testing: '3.4a' + '123e5' ---
+float(12300003.4)
+--- testing: '3.4a' + '123e5xyz' ---
+float(12300003.4)
+--- testing: '3.4a' + ' 123abc' ---
+float(126.4)
+--- testing: '3.4a' + '123 abc' ---
+float(126.4)
+--- testing: '3.4a' + '123abc ' ---
+float(126.4)
+--- testing: '3.4a' + '3.4a' ---
+float(6.8)
+--- testing: '3.4a' + 'a5.9' ---
+float(3.4)
+--- testing: 'a5.9' + '0' ---
+int(0)
+--- testing: 'a5.9' + '65' ---
+int(65)
+--- testing: 'a5.9' + '-44' ---
+int(-44)
+--- testing: 'a5.9' + '1.2' ---
+float(1.2)
+--- testing: 'a5.9' + '-7.7' ---
+float(-7.7)
+--- testing: 'a5.9' + 'abc' ---
+int(0)
+--- testing: 'a5.9' + '123abc' ---
+int(123)
+--- testing: 'a5.9' + '123e5' ---
+float(12300000)
+--- testing: 'a5.9' + '123e5xyz' ---
+float(12300000)
+--- testing: 'a5.9' + ' 123abc' ---
+int(123)
+--- testing: 'a5.9' + '123 abc' ---
+int(123)
+--- testing: 'a5.9' + '123abc ' ---
+int(123)
+--- testing: 'a5.9' + '3.4a' ---
+float(3.4)
+--- testing: 'a5.9' + 'a5.9' ---
+int(0)
+===DONE===
diff --git a/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt
new file mode 100644
index 0000000..f463e5d
--- /dev/null
+++ b/tests/lang/operators/bitwiseAnd_basiclong_64bit.phpt
@@ -0,0 +1,582 @@
+--TEST--
+Test & operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal & $otherVal ---\n";
+ var_dump($longVal&$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal & $longVal ---\n";
+ var_dump($otherVal&$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 & 0 ---
+int(0)
+--- testing: 9223372036854775807 & 1 ---
+int(1)
+--- testing: 9223372036854775807 & -1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 & 7 ---
+int(7)
+--- testing: 9223372036854775807 & 9 ---
+int(9)
+--- testing: 9223372036854775807 & 65 ---
+int(65)
+--- testing: 9223372036854775807 & -44 ---
+int(9223372036854775764)
+--- testing: 9223372036854775807 & 2147483647 ---
+int(2147483647)
+--- testing: 9223372036854775807 & 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -9223372036854775808 & 0 ---
+int(0)
+--- testing: -9223372036854775808 & 1 ---
+int(0)
+--- testing: -9223372036854775808 & -1 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 & 7 ---
+int(0)
+--- testing: -9223372036854775808 & 9 ---
+int(0)
+--- testing: -9223372036854775808 & 65 ---
+int(0)
+--- testing: -9223372036854775808 & -44 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 & 2147483647 ---
+int(0)
+--- testing: -9223372036854775808 & 9223372036854775807 ---
+int(0)
+--- testing: 2147483647 & 0 ---
+int(0)
+--- testing: 2147483647 & 1 ---
+int(1)
+--- testing: 2147483647 & -1 ---
+int(2147483647)
+--- testing: 2147483647 & 7 ---
+int(7)
+--- testing: 2147483647 & 9 ---
+int(9)
+--- testing: 2147483647 & 65 ---
+int(65)
+--- testing: 2147483647 & -44 ---
+int(2147483604)
+--- testing: 2147483647 & 2147483647 ---
+int(2147483647)
+--- testing: 2147483647 & 9223372036854775807 ---
+int(2147483647)
+--- testing: -2147483648 & 0 ---
+int(0)
+--- testing: -2147483648 & 1 ---
+int(0)
+--- testing: -2147483648 & -1 ---
+int(-2147483648)
+--- testing: -2147483648 & 7 ---
+int(0)
+--- testing: -2147483648 & 9 ---
+int(0)
+--- testing: -2147483648 & 65 ---
+int(0)
+--- testing: -2147483648 & -44 ---
+int(-2147483648)
+--- testing: -2147483648 & 2147483647 ---
+int(0)
+--- testing: -2147483648 & 9223372036854775807 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 & 0 ---
+int(0)
+--- testing: 9223372034707292160 & 1 ---
+int(0)
+--- testing: 9223372034707292160 & -1 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 & 7 ---
+int(0)
+--- testing: 9223372034707292160 & 9 ---
+int(0)
+--- testing: 9223372034707292160 & 65 ---
+int(0)
+--- testing: 9223372034707292160 & -44 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 & 2147483647 ---
+int(0)
+--- testing: 9223372034707292160 & 9223372036854775807 ---
+int(9223372034707292160)
+--- testing: -9223372034707292160 & 0 ---
+int(0)
+--- testing: -9223372034707292160 & 1 ---
+int(0)
+--- testing: -9223372034707292160 & -1 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 & 7 ---
+int(0)
+--- testing: -9223372034707292160 & 9 ---
+int(0)
+--- testing: -9223372034707292160 & 65 ---
+int(0)
+--- testing: -9223372034707292160 & -44 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 & 2147483647 ---
+int(0)
+--- testing: -9223372034707292160 & 9223372036854775807 ---
+int(2147483648)
+--- testing: 2147483648 & 0 ---
+int(0)
+--- testing: 2147483648 & 1 ---
+int(0)
+--- testing: 2147483648 & -1 ---
+int(2147483648)
+--- testing: 2147483648 & 7 ---
+int(0)
+--- testing: 2147483648 & 9 ---
+int(0)
+--- testing: 2147483648 & 65 ---
+int(0)
+--- testing: 2147483648 & -44 ---
+int(2147483648)
+--- testing: 2147483648 & 2147483647 ---
+int(0)
+--- testing: 2147483648 & 9223372036854775807 ---
+int(2147483648)
+--- testing: -2147483649 & 0 ---
+int(0)
+--- testing: -2147483649 & 1 ---
+int(1)
+--- testing: -2147483649 & -1 ---
+int(-2147483649)
+--- testing: -2147483649 & 7 ---
+int(7)
+--- testing: -2147483649 & 9 ---
+int(9)
+--- testing: -2147483649 & 65 ---
+int(65)
+--- testing: -2147483649 & -44 ---
+int(-2147483692)
+--- testing: -2147483649 & 2147483647 ---
+int(2147483647)
+--- testing: -2147483649 & 9223372036854775807 ---
+int(9223372034707292159)
+--- testing: 4294967294 & 0 ---
+int(0)
+--- testing: 4294967294 & 1 ---
+int(0)
+--- testing: 4294967294 & -1 ---
+int(4294967294)
+--- testing: 4294967294 & 7 ---
+int(6)
+--- testing: 4294967294 & 9 ---
+int(8)
+--- testing: 4294967294 & 65 ---
+int(64)
+--- testing: 4294967294 & -44 ---
+int(4294967252)
+--- testing: 4294967294 & 2147483647 ---
+int(2147483646)
+--- testing: 4294967294 & 9223372036854775807 ---
+int(4294967294)
+--- testing: 4294967295 & 0 ---
+int(0)
+--- testing: 4294967295 & 1 ---
+int(1)
+--- testing: 4294967295 & -1 ---
+int(4294967295)
+--- testing: 4294967295 & 7 ---
+int(7)
+--- testing: 4294967295 & 9 ---
+int(9)
+--- testing: 4294967295 & 65 ---
+int(65)
+--- testing: 4294967295 & -44 ---
+int(4294967252)
+--- testing: 4294967295 & 2147483647 ---
+int(2147483647)
+--- testing: 4294967295 & 9223372036854775807 ---
+int(4294967295)
+--- testing: 4294967293 & 0 ---
+int(0)
+--- testing: 4294967293 & 1 ---
+int(1)
+--- testing: 4294967293 & -1 ---
+int(4294967293)
+--- testing: 4294967293 & 7 ---
+int(5)
+--- testing: 4294967293 & 9 ---
+int(9)
+--- testing: 4294967293 & 65 ---
+int(65)
+--- testing: 4294967293 & -44 ---
+int(4294967252)
+--- testing: 4294967293 & 2147483647 ---
+int(2147483645)
+--- testing: 4294967293 & 9223372036854775807 ---
+int(4294967293)
+--- testing: 9223372036854775806 & 0 ---
+int(0)
+--- testing: 9223372036854775806 & 1 ---
+int(0)
+--- testing: 9223372036854775806 & -1 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 & 7 ---
+int(6)
+--- testing: 9223372036854775806 & 9 ---
+int(8)
+--- testing: 9223372036854775806 & 65 ---
+int(64)
+--- testing: 9223372036854775806 & -44 ---
+int(9223372036854775764)
+--- testing: 9223372036854775806 & 2147483647 ---
+int(2147483646)
+--- testing: 9223372036854775806 & 9223372036854775807 ---
+int(9223372036854775806)
+--- testing: 9.2233720368548E+18 & 0 ---
+int(0)
+--- testing: 9.2233720368548E+18 & 1 ---
+int(0)
+--- testing: 9.2233720368548E+18 & -1 ---
+int(-9223372036854775808)
+--- testing: 9.2233720368548E+18 & 7 ---
+int(0)
+--- testing: 9.2233720368548E+18 & 9 ---
+int(0)
+--- testing: 9.2233720368548E+18 & 65 ---
+int(0)
+--- testing: 9.2233720368548E+18 & -44 ---
+int(-9223372036854775808)
+--- testing: 9.2233720368548E+18 & 2147483647 ---
+int(0)
+--- testing: 9.2233720368548E+18 & 9223372036854775807 ---
+int(0)
+--- testing: -9223372036854775807 & 0 ---
+int(0)
+--- testing: -9223372036854775807 & 1 ---
+int(1)
+--- testing: -9223372036854775807 & -1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 & 7 ---
+int(1)
+--- testing: -9223372036854775807 & 9 ---
+int(1)
+--- testing: -9223372036854775807 & 65 ---
+int(1)
+--- testing: -9223372036854775807 & -44 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775807 & 2147483647 ---
+int(1)
+--- testing: -9223372036854775807 & 9223372036854775807 ---
+int(1)
+--- testing: -9.2233720368548E+18 & 0 ---
+int(0)
+--- testing: -9.2233720368548E+18 & 1 ---
+int(0)
+--- testing: -9.2233720368548E+18 & -1 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 & 7 ---
+int(0)
+--- testing: -9.2233720368548E+18 & 9 ---
+int(0)
+--- testing: -9.2233720368548E+18 & 65 ---
+int(0)
+--- testing: -9.2233720368548E+18 & -44 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 & 2147483647 ---
+int(0)
+--- testing: -9.2233720368548E+18 & 9223372036854775807 ---
+int(0)
+--- testing: 0 & 9223372036854775807 ---
+int(0)
+--- testing: 0 & -9223372036854775808 ---
+int(0)
+--- testing: 0 & 2147483647 ---
+int(0)
+--- testing: 0 & -2147483648 ---
+int(0)
+--- testing: 0 & 9223372034707292160 ---
+int(0)
+--- testing: 0 & -9223372034707292160 ---
+int(0)
+--- testing: 0 & 2147483648 ---
+int(0)
+--- testing: 0 & -2147483649 ---
+int(0)
+--- testing: 0 & 4294967294 ---
+int(0)
+--- testing: 0 & 4294967295 ---
+int(0)
+--- testing: 0 & 4294967293 ---
+int(0)
+--- testing: 0 & 9223372036854775806 ---
+int(0)
+--- testing: 0 & 9.2233720368548E+18 ---
+int(0)
+--- testing: 0 & -9223372036854775807 ---
+int(0)
+--- testing: 0 & -9.2233720368548E+18 ---
+int(0)
+--- testing: 1 & 9223372036854775807 ---
+int(1)
+--- testing: 1 & -9223372036854775808 ---
+int(0)
+--- testing: 1 & 2147483647 ---
+int(1)
+--- testing: 1 & -2147483648 ---
+int(0)
+--- testing: 1 & 9223372034707292160 ---
+int(0)
+--- testing: 1 & -9223372034707292160 ---
+int(0)
+--- testing: 1 & 2147483648 ---
+int(0)
+--- testing: 1 & -2147483649 ---
+int(1)
+--- testing: 1 & 4294967294 ---
+int(0)
+--- testing: 1 & 4294967295 ---
+int(1)
+--- testing: 1 & 4294967293 ---
+int(1)
+--- testing: 1 & 9223372036854775806 ---
+int(0)
+--- testing: 1 & 9.2233720368548E+18 ---
+int(0)
+--- testing: 1 & -9223372036854775807 ---
+int(1)
+--- testing: 1 & -9.2233720368548E+18 ---
+int(0)
+--- testing: -1 & 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -1 & -9223372036854775808 ---
+int(-9223372036854775808)
+--- testing: -1 & 2147483647 ---
+int(2147483647)
+--- testing: -1 & -2147483648 ---
+int(-2147483648)
+--- testing: -1 & 9223372034707292160 ---
+int(9223372034707292160)
+--- testing: -1 & -9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: -1 & 2147483648 ---
+int(2147483648)
+--- testing: -1 & -2147483649 ---
+int(-2147483649)
+--- testing: -1 & 4294967294 ---
+int(4294967294)
+--- testing: -1 & 4294967295 ---
+int(4294967295)
+--- testing: -1 & 4294967293 ---
+int(4294967293)
+--- testing: -1 & 9223372036854775806 ---
+int(9223372036854775806)
+--- testing: -1 & 9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: -1 & -9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: -1 & -9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: 7 & 9223372036854775807 ---
+int(7)
+--- testing: 7 & -9223372036854775808 ---
+int(0)
+--- testing: 7 & 2147483647 ---
+int(7)
+--- testing: 7 & -2147483648 ---
+int(0)
+--- testing: 7 & 9223372034707292160 ---
+int(0)
+--- testing: 7 & -9223372034707292160 ---
+int(0)
+--- testing: 7 & 2147483648 ---
+int(0)
+--- testing: 7 & -2147483649 ---
+int(7)
+--- testing: 7 & 4294967294 ---
+int(6)
+--- testing: 7 & 4294967295 ---
+int(7)
+--- testing: 7 & 4294967293 ---
+int(5)
+--- testing: 7 & 9223372036854775806 ---
+int(6)
+--- testing: 7 & 9.2233720368548E+18 ---
+int(0)
+--- testing: 7 & -9223372036854775807 ---
+int(1)
+--- testing: 7 & -9.2233720368548E+18 ---
+int(0)
+--- testing: 9 & 9223372036854775807 ---
+int(9)
+--- testing: 9 & -9223372036854775808 ---
+int(0)
+--- testing: 9 & 2147483647 ---
+int(9)
+--- testing: 9 & -2147483648 ---
+int(0)
+--- testing: 9 & 9223372034707292160 ---
+int(0)
+--- testing: 9 & -9223372034707292160 ---
+int(0)
+--- testing: 9 & 2147483648 ---
+int(0)
+--- testing: 9 & -2147483649 ---
+int(9)
+--- testing: 9 & 4294967294 ---
+int(8)
+--- testing: 9 & 4294967295 ---
+int(9)
+--- testing: 9 & 4294967293 ---
+int(9)
+--- testing: 9 & 9223372036854775806 ---
+int(8)
+--- testing: 9 & 9.2233720368548E+18 ---
+int(0)
+--- testing: 9 & -9223372036854775807 ---
+int(1)
+--- testing: 9 & -9.2233720368548E+18 ---
+int(0)
+--- testing: 65 & 9223372036854775807 ---
+int(65)
+--- testing: 65 & -9223372036854775808 ---
+int(0)
+--- testing: 65 & 2147483647 ---
+int(65)
+--- testing: 65 & -2147483648 ---
+int(0)
+--- testing: 65 & 9223372034707292160 ---
+int(0)
+--- testing: 65 & -9223372034707292160 ---
+int(0)
+--- testing: 65 & 2147483648 ---
+int(0)
+--- testing: 65 & -2147483649 ---
+int(65)
+--- testing: 65 & 4294967294 ---
+int(64)
+--- testing: 65 & 4294967295 ---
+int(65)
+--- testing: 65 & 4294967293 ---
+int(65)
+--- testing: 65 & 9223372036854775806 ---
+int(64)
+--- testing: 65 & 9.2233720368548E+18 ---
+int(0)
+--- testing: 65 & -9223372036854775807 ---
+int(1)
+--- testing: 65 & -9.2233720368548E+18 ---
+int(0)
+--- testing: -44 & 9223372036854775807 ---
+int(9223372036854775764)
+--- testing: -44 & -9223372036854775808 ---
+int(-9223372036854775808)
+--- testing: -44 & 2147483647 ---
+int(2147483604)
+--- testing: -44 & -2147483648 ---
+int(-2147483648)
+--- testing: -44 & 9223372034707292160 ---
+int(9223372034707292160)
+--- testing: -44 & -9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: -44 & 2147483648 ---
+int(2147483648)
+--- testing: -44 & -2147483649 ---
+int(-2147483692)
+--- testing: -44 & 4294967294 ---
+int(4294967252)
+--- testing: -44 & 4294967295 ---
+int(4294967252)
+--- testing: -44 & 4294967293 ---
+int(4294967252)
+--- testing: -44 & 9223372036854775806 ---
+int(9223372036854775764)
+--- testing: -44 & 9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: -44 & -9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -44 & -9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: 2147483647 & 9223372036854775807 ---
+int(2147483647)
+--- testing: 2147483647 & -9223372036854775808 ---
+int(0)
+--- testing: 2147483647 & 2147483647 ---
+int(2147483647)
+--- testing: 2147483647 & -2147483648 ---
+int(0)
+--- testing: 2147483647 & 9223372034707292160 ---
+int(0)
+--- testing: 2147483647 & -9223372034707292160 ---
+int(0)
+--- testing: 2147483647 & 2147483648 ---
+int(0)
+--- testing: 2147483647 & -2147483649 ---
+int(2147483647)
+--- testing: 2147483647 & 4294967294 ---
+int(2147483646)
+--- testing: 2147483647 & 4294967295 ---
+int(2147483647)
+--- testing: 2147483647 & 4294967293 ---
+int(2147483645)
+--- testing: 2147483647 & 9223372036854775806 ---
+int(2147483646)
+--- testing: 2147483647 & 9.2233720368548E+18 ---
+int(0)
+--- testing: 2147483647 & -9223372036854775807 ---
+int(1)
+--- testing: 2147483647 & -9.2233720368548E+18 ---
+int(0)
+--- testing: 9223372036854775807 & 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 & -9223372036854775808 ---
+int(0)
+--- testing: 9223372036854775807 & 2147483647 ---
+int(2147483647)
+--- testing: 9223372036854775807 & -2147483648 ---
+int(9223372034707292160)
+--- testing: 9223372036854775807 & 9223372034707292160 ---
+int(9223372034707292160)
+--- testing: 9223372036854775807 & -9223372034707292160 ---
+int(2147483648)
+--- testing: 9223372036854775807 & 2147483648 ---
+int(2147483648)
+--- testing: 9223372036854775807 & -2147483649 ---
+int(9223372034707292159)
+--- testing: 9223372036854775807 & 4294967294 ---
+int(4294967294)
+--- testing: 9223372036854775807 & 4294967295 ---
+int(4294967295)
+--- testing: 9223372036854775807 & 4294967293 ---
+int(4294967293)
+--- testing: 9223372036854775807 & 9223372036854775806 ---
+int(9223372036854775806)
+--- testing: 9223372036854775807 & 9.2233720368548E+18 ---
+int(0)
+--- testing: 9223372036854775807 & -9223372036854775807 ---
+int(1)
+--- testing: 9223372036854775807 & -9.2233720368548E+18 ---
+int(0)
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/bitwiseAnd_variationStr.phpt b/tests/lang/operators/bitwiseAnd_variationStr.phpt
new file mode 100644
index 0000000..2602270
--- /dev/null
+++ b/tests/lang/operators/bitwiseAnd_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test & operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' & '$otherVal' ---\n";
+ var_dump(bin2hex($strVal&$otherVal));
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' & '0' ---
+string(2) "30"
+--- testing: '0' & '65' ---
+string(2) "30"
+--- testing: '0' & '-44' ---
+string(2) "20"
+--- testing: '0' & '1.2' ---
+string(2) "30"
+--- testing: '0' & '-7.7' ---
+string(2) "20"
+--- testing: '0' & 'abc' ---
+string(2) "20"
+--- testing: '0' & '123abc' ---
+string(2) "30"
+--- testing: '0' & '123e5' ---
+string(2) "30"
+--- testing: '0' & '123e5xyz' ---
+string(2) "30"
+--- testing: '0' & ' 123abc' ---
+string(2) "20"
+--- testing: '0' & '123 abc' ---
+string(2) "30"
+--- testing: '0' & '123abc ' ---
+string(2) "30"
+--- testing: '0' & '3.4a' ---
+string(2) "30"
+--- testing: '0' & 'a5.9' ---
+string(2) "20"
+--- testing: '65' & '0' ---
+string(2) "30"
+--- testing: '65' & '65' ---
+string(4) "3635"
+--- testing: '65' & '-44' ---
+string(4) "2434"
+--- testing: '65' & '1.2' ---
+string(4) "3024"
+--- testing: '65' & '-7.7' ---
+string(4) "2435"
+--- testing: '65' & 'abc' ---
+string(4) "2020"
+--- testing: '65' & '123abc' ---
+string(4) "3030"
+--- testing: '65' & '123e5' ---
+string(4) "3030"
+--- testing: '65' & '123e5xyz' ---
+string(4) "3030"
+--- testing: '65' & ' 123abc' ---
+string(4) "2031"
+--- testing: '65' & '123 abc' ---
+string(4) "3030"
+--- testing: '65' & '123abc ' ---
+string(4) "3030"
+--- testing: '65' & '3.4a' ---
+string(4) "3224"
+--- testing: '65' & 'a5.9' ---
+string(4) "2035"
+--- testing: '-44' & '0' ---
+string(2) "20"
+--- testing: '-44' & '65' ---
+string(4) "2434"
+--- testing: '-44' & '-44' ---
+string(6) "2d3434"
+--- testing: '-44' & '1.2' ---
+string(6) "212430"
+--- testing: '-44' & '-7.7' ---
+string(6) "2d3424"
+--- testing: '-44' & 'abc' ---
+string(6) "212020"
+--- testing: '-44' & '123abc' ---
+string(6) "213030"
+--- testing: '-44' & '123e5' ---
+string(6) "213030"
+--- testing: '-44' & '123e5xyz' ---
+string(6) "213030"
+--- testing: '-44' & ' 123abc' ---
+string(6) "203030"
+--- testing: '-44' & '123 abc' ---
+string(6) "213030"
+--- testing: '-44' & '123abc ' ---
+string(6) "213030"
+--- testing: '-44' & '3.4a' ---
+string(6) "212434"
+--- testing: '-44' & 'a5.9' ---
+string(6) "213424"
+--- testing: '1.2' & '0' ---
+string(2) "30"
+--- testing: '1.2' & '65' ---
+string(4) "3024"
+--- testing: '1.2' & '-44' ---
+string(6) "212430"
+--- testing: '1.2' & '1.2' ---
+string(6) "312e32"
+--- testing: '1.2' & '-7.7' ---
+string(6) "212622"
+--- testing: '1.2' & 'abc' ---
+string(6) "212222"
+--- testing: '1.2' & '123abc' ---
+string(6) "312232"
+--- testing: '1.2' & '123e5' ---
+string(6) "312232"
+--- testing: '1.2' & '123e5xyz' ---
+string(6) "312232"
+--- testing: '1.2' & ' 123abc' ---
+string(6) "202032"
+--- testing: '1.2' & '123 abc' ---
+string(6) "312232"
+--- testing: '1.2' & '123abc ' ---
+string(6) "312232"
+--- testing: '1.2' & '3.4a' ---
+string(6) "312e30"
+--- testing: '1.2' & 'a5.9' ---
+string(6) "212422"
+--- testing: '-7.7' & '0' ---
+string(2) "20"
+--- testing: '-7.7' & '65' ---
+string(4) "2435"
+--- testing: '-7.7' & '-44' ---
+string(6) "2d3424"
+--- testing: '-7.7' & '1.2' ---
+string(6) "212622"
+--- testing: '-7.7' & '-7.7' ---
+string(8) "2d372e37"
+--- testing: '-7.7' & 'abc' ---
+string(6) "212222"
+--- testing: '-7.7' & '123abc' ---
+string(8) "21322221"
+--- testing: '-7.7' & '123e5' ---
+string(8) "21322225"
+--- testing: '-7.7' & '123e5xyz' ---
+string(8) "21322225"
+--- testing: '-7.7' & ' 123abc' ---
+string(8) "20312233"
+--- testing: '-7.7' & '123 abc' ---
+string(8) "21322220"
+--- testing: '-7.7' & '123abc ' ---
+string(8) "21322221"
+--- testing: '-7.7' & '3.4a' ---
+string(8) "21262421"
+--- testing: '-7.7' & 'a5.9' ---
+string(8) "21352e31"
+--- testing: 'abc' & '0' ---
+string(2) "20"
+--- testing: 'abc' & '65' ---
+string(4) "2020"
+--- testing: 'abc' & '-44' ---
+string(6) "212020"
+--- testing: 'abc' & '1.2' ---
+string(6) "212222"
+--- testing: 'abc' & '-7.7' ---
+string(6) "212222"
+--- testing: 'abc' & 'abc' ---
+string(6) "616263"
+--- testing: 'abc' & '123abc' ---
+string(6) "212223"
+--- testing: 'abc' & '123e5' ---
+string(6) "212223"
+--- testing: 'abc' & '123e5xyz' ---
+string(6) "212223"
+--- testing: 'abc' & ' 123abc' ---
+string(6) "202022"
+--- testing: 'abc' & '123 abc' ---
+string(6) "212223"
+--- testing: 'abc' & '123abc ' ---
+string(6) "212223"
+--- testing: 'abc' & '3.4a' ---
+string(6) "212220"
+--- testing: 'abc' & 'a5.9' ---
+string(6) "612022"
+--- testing: '123abc' & '0' ---
+string(2) "30"
+--- testing: '123abc' & '65' ---
+string(4) "3030"
+--- testing: '123abc' & '-44' ---
+string(6) "213030"
+--- testing: '123abc' & '1.2' ---
+string(6) "312232"
+--- testing: '123abc' & '-7.7' ---
+string(8) "21322221"
+--- testing: '123abc' & 'abc' ---
+string(6) "212223"
+--- testing: '123abc' & '123abc' ---
+string(12) "313233616263"
+--- testing: '123abc' & '123e5' ---
+string(10) "3132336120"
+--- testing: '123abc' & '123e5xyz' ---
+string(12) "313233612060"
+--- testing: '123abc' & ' 123abc' ---
+string(12) "203032216062"
+--- testing: '123abc' & '123 abc' ---
+string(12) "313233206062"
+--- testing: '123abc' & '123abc ' ---
+string(12) "313233616263"
+--- testing: '123abc' & '3.4a' ---
+string(8) "31223061"
+--- testing: '123abc' & 'a5.9' ---
+string(8) "21302221"
+--- testing: '123e5' & '0' ---
+string(2) "30"
+--- testing: '123e5' & '65' ---
+string(4) "3030"
+--- testing: '123e5' & '-44' ---
+string(6) "213030"
+--- testing: '123e5' & '1.2' ---
+string(6) "312232"
+--- testing: '123e5' & '-7.7' ---
+string(8) "21322225"
+--- testing: '123e5' & 'abc' ---
+string(6) "212223"
+--- testing: '123e5' & '123abc' ---
+string(10) "3132336120"
+--- testing: '123e5' & '123e5' ---
+string(10) "3132336535"
+--- testing: '123e5' & '123e5xyz' ---
+string(10) "3132336535"
+--- testing: '123e5' & ' 123abc' ---
+string(10) "2030322121"
+--- testing: '123e5' & '123 abc' ---
+string(10) "3132332021"
+--- testing: '123e5' & '123abc ' ---
+string(10) "3132336120"
+--- testing: '123e5' & '3.4a' ---
+string(8) "31223061"
+--- testing: '123e5' & 'a5.9' ---
+string(8) "21302221"
+--- testing: '123e5xyz' & '0' ---
+string(2) "30"
+--- testing: '123e5xyz' & '65' ---
+string(4) "3030"
+--- testing: '123e5xyz' & '-44' ---
+string(6) "213030"
+--- testing: '123e5xyz' & '1.2' ---
+string(6) "312232"
+--- testing: '123e5xyz' & '-7.7' ---
+string(8) "21322225"
+--- testing: '123e5xyz' & 'abc' ---
+string(6) "212223"
+--- testing: '123e5xyz' & '123abc' ---
+string(12) "313233612060"
+--- testing: '123e5xyz' & '123e5' ---
+string(10) "3132336535"
+--- testing: '123e5xyz' & '123e5xyz' ---
+string(16) "313233653578797a"
+--- testing: '123e5xyz' & ' 123abc' ---
+string(14) "20303221216061"
+--- testing: '123e5xyz' & '123 abc' ---
+string(14) "31323320216061"
+--- testing: '123e5xyz' & '123abc ' ---
+string(14) "31323361206020"
+--- testing: '123e5xyz' & '3.4a' ---
+string(8) "31223061"
+--- testing: '123e5xyz' & 'a5.9' ---
+string(8) "21302221"
+--- testing: ' 123abc' & '0' ---
+string(2) "20"
+--- testing: ' 123abc' & '65' ---
+string(4) "2031"
+--- testing: ' 123abc' & '-44' ---
+string(6) "203030"
+--- testing: ' 123abc' & '1.2' ---
+string(6) "202032"
+--- testing: ' 123abc' & '-7.7' ---
+string(8) "20312233"
+--- testing: ' 123abc' & 'abc' ---
+string(6) "202022"
+--- testing: ' 123abc' & '123abc' ---
+string(12) "203032216062"
+--- testing: ' 123abc' & '123e5' ---
+string(10) "2030322121"
+--- testing: ' 123abc' & '123e5xyz' ---
+string(14) "20303221216061"
+--- testing: ' 123abc' & ' 123abc' ---
+string(14) "20313233616263"
+--- testing: ' 123abc' & '123 abc' ---
+string(14) "20303220616263"
+--- testing: ' 123abc' & '123abc ' ---
+string(14) "20303221606220"
+--- testing: ' 123abc' & '3.4a' ---
+string(8) "20203021"
+--- testing: ' 123abc' & 'a5.9' ---
+string(8) "20312231"
+--- testing: '123 abc' & '0' ---
+string(2) "30"
+--- testing: '123 abc' & '65' ---
+string(4) "3030"
+--- testing: '123 abc' & '-44' ---
+string(6) "213030"
+--- testing: '123 abc' & '1.2' ---
+string(6) "312232"
+--- testing: '123 abc' & '-7.7' ---
+string(8) "21322220"
+--- testing: '123 abc' & 'abc' ---
+string(6) "212223"
+--- testing: '123 abc' & '123abc' ---
+string(12) "313233206062"
+--- testing: '123 abc' & '123e5' ---
+string(10) "3132332021"
+--- testing: '123 abc' & '123e5xyz' ---
+string(14) "31323320216061"
+--- testing: '123 abc' & ' 123abc' ---
+string(14) "20303220616263"
+--- testing: '123 abc' & '123 abc' ---
+string(14) "31323320616263"
+--- testing: '123 abc' & '123abc ' ---
+string(14) "31323320606220"
+--- testing: '123 abc' & '3.4a' ---
+string(8) "31223020"
+--- testing: '123 abc' & 'a5.9' ---
+string(8) "21302220"
+--- testing: '123abc ' & '0' ---
+string(2) "30"
+--- testing: '123abc ' & '65' ---
+string(4) "3030"
+--- testing: '123abc ' & '-44' ---
+string(6) "213030"
+--- testing: '123abc ' & '1.2' ---
+string(6) "312232"
+--- testing: '123abc ' & '-7.7' ---
+string(8) "21322221"
+--- testing: '123abc ' & 'abc' ---
+string(6) "212223"
+--- testing: '123abc ' & '123abc' ---
+string(12) "313233616263"
+--- testing: '123abc ' & '123e5' ---
+string(10) "3132336120"
+--- testing: '123abc ' & '123e5xyz' ---
+string(14) "31323361206020"
+--- testing: '123abc ' & ' 123abc' ---
+string(14) "20303221606220"
+--- testing: '123abc ' & '123 abc' ---
+string(14) "31323320606220"
+--- testing: '123abc ' & '123abc ' ---
+string(14) "31323361626320"
+--- testing: '123abc ' & '3.4a' ---
+string(8) "31223061"
+--- testing: '123abc ' & 'a5.9' ---
+string(8) "21302221"
+--- testing: '3.4a' & '0' ---
+string(2) "30"
+--- testing: '3.4a' & '65' ---
+string(4) "3224"
+--- testing: '3.4a' & '-44' ---
+string(6) "212434"
+--- testing: '3.4a' & '1.2' ---
+string(6) "312e30"
+--- testing: '3.4a' & '-7.7' ---
+string(8) "21262421"
+--- testing: '3.4a' & 'abc' ---
+string(6) "212220"
+--- testing: '3.4a' & '123abc' ---
+string(8) "31223061"
+--- testing: '3.4a' & '123e5' ---
+string(8) "31223061"
+--- testing: '3.4a' & '123e5xyz' ---
+string(8) "31223061"
+--- testing: '3.4a' & ' 123abc' ---
+string(8) "20203021"
+--- testing: '3.4a' & '123 abc' ---
+string(8) "31223020"
+--- testing: '3.4a' & '123abc ' ---
+string(8) "31223061"
+--- testing: '3.4a' & '3.4a' ---
+string(8) "332e3461"
+--- testing: '3.4a' & 'a5.9' ---
+string(8) "21242421"
+--- testing: 'a5.9' & '0' ---
+string(2) "20"
+--- testing: 'a5.9' & '65' ---
+string(4) "2035"
+--- testing: 'a5.9' & '-44' ---
+string(6) "213424"
+--- testing: 'a5.9' & '1.2' ---
+string(6) "212422"
+--- testing: 'a5.9' & '-7.7' ---
+string(8) "21352e31"
+--- testing: 'a5.9' & 'abc' ---
+string(6) "612022"
+--- testing: 'a5.9' & '123abc' ---
+string(8) "21302221"
+--- testing: 'a5.9' & '123e5' ---
+string(8) "21302221"
+--- testing: 'a5.9' & '123e5xyz' ---
+string(8) "21302221"
+--- testing: 'a5.9' & ' 123abc' ---
+string(8) "20312231"
+--- testing: 'a5.9' & '123 abc' ---
+string(8) "21302220"
+--- testing: 'a5.9' & '123abc ' ---
+string(8) "21302221"
+--- testing: 'a5.9' & '3.4a' ---
+string(8) "21242421"
+--- testing: 'a5.9' & 'a5.9' ---
+string(8) "61352e39"
+===DONE===
diff --git a/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt b/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt
new file mode 100644
index 0000000..227b734
--- /dev/null
+++ b/tests/lang/operators/bitwiseNot_basiclong_64bit.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Test ~N operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+
+foreach ($longVals as $longVal) {
+ echo "--- testing: $longVal ---\n";
+ var_dump(~$longVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 ---
+int(9223372036854775807)
+--- testing: 2147483647 ---
+int(-2147483648)
+--- testing: -2147483648 ---
+int(2147483647)
+--- testing: 9223372034707292160 ---
+int(-9223372034707292161)
+--- testing: -9223372034707292160 ---
+int(9223372034707292159)
+--- testing: 2147483648 ---
+int(-2147483649)
+--- testing: -2147483649 ---
+int(2147483648)
+--- testing: 4294967294 ---
+int(-4294967295)
+--- testing: 4294967295 ---
+int(-4294967296)
+--- testing: 4294967293 ---
+int(-4294967294)
+--- testing: 9223372036854775806 ---
+int(-9223372036854775807)
+--- testing: 9.2233720368548E+18 ---
+int(9223372036854775807)
+--- testing: -9223372036854775807 ---
+int(9223372036854775806)
+--- testing: -9.2233720368548E+18 ---
+int(9223372036854775807)
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/bitwiseNot_variationStr.phpt b/tests/lang/operators/bitwiseNot_variationStr.phpt
new file mode 100644
index 0000000..3e7b698
--- /dev/null
+++ b/tests/lang/operators/bitwiseNot_variationStr.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Test ~N operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+
+foreach ($strVals as $strVal) {
+ echo "--- testing: '$strVal' ---\n";
+ var_dump(bin2hex(~$strVal));
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' ---
+string(2) "cf"
+--- testing: '65' ---
+string(4) "c9ca"
+--- testing: '-44' ---
+string(6) "d2cbcb"
+--- testing: '1.2' ---
+string(6) "ced1cd"
+--- testing: '-7.7' ---
+string(8) "d2c8d1c8"
+--- testing: 'abc' ---
+string(6) "9e9d9c"
+--- testing: '123abc' ---
+string(12) "cecdcc9e9d9c"
+--- testing: '123e5' ---
+string(10) "cecdcc9aca"
+--- testing: '123e5xyz' ---
+string(16) "cecdcc9aca878685"
+--- testing: ' 123abc' ---
+string(14) "dfcecdcc9e9d9c"
+--- testing: '123 abc' ---
+string(14) "cecdccdf9e9d9c"
+--- testing: '123abc ' ---
+string(14) "cecdcc9e9d9cdf"
+--- testing: '3.4a' ---
+string(8) "ccd1cb9e"
+--- testing: 'a5.9' ---
+string(8) "9ecad1c6"
+===DONE===
diff --git a/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt
new file mode 100644
index 0000000..e26d46a
--- /dev/null
+++ b/tests/lang/operators/bitwiseOr_basiclong_64bit.phpt
@@ -0,0 +1,583 @@
+--TEST--
+Test | operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal | $otherVal ---\n";
+ var_dump($longVal|$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal | $longVal ---\n";
+ var_dump($otherVal|$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 | 0 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | -1 ---
+int(-1)
+--- testing: 9223372036854775807 | 7 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 9 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 65 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | -44 ---
+int(-1)
+--- testing: 9223372036854775807 | 2147483647 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -9223372036854775808 | 0 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 | 1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775808 | -1 ---
+int(-1)
+--- testing: -9223372036854775808 | 7 ---
+int(-9223372036854775801)
+--- testing: -9223372036854775808 | 9 ---
+int(-9223372036854775799)
+--- testing: -9223372036854775808 | 65 ---
+int(-9223372036854775743)
+--- testing: -9223372036854775808 | -44 ---
+int(-44)
+--- testing: -9223372036854775808 | 2147483647 ---
+int(-9223372034707292161)
+--- testing: -9223372036854775808 | 9223372036854775807 ---
+int(-1)
+--- testing: 2147483647 | 0 ---
+int(2147483647)
+--- testing: 2147483647 | 1 ---
+int(2147483647)
+--- testing: 2147483647 | -1 ---
+int(-1)
+--- testing: 2147483647 | 7 ---
+int(2147483647)
+--- testing: 2147483647 | 9 ---
+int(2147483647)
+--- testing: 2147483647 | 65 ---
+int(2147483647)
+--- testing: 2147483647 | -44 ---
+int(-1)
+--- testing: 2147483647 | 2147483647 ---
+int(2147483647)
+--- testing: 2147483647 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -2147483648 | 0 ---
+int(-2147483648)
+--- testing: -2147483648 | 1 ---
+int(-2147483647)
+--- testing: -2147483648 | -1 ---
+int(-1)
+--- testing: -2147483648 | 7 ---
+int(-2147483641)
+--- testing: -2147483648 | 9 ---
+int(-2147483639)
+--- testing: -2147483648 | 65 ---
+int(-2147483583)
+--- testing: -2147483648 | -44 ---
+int(-44)
+--- testing: -2147483648 | 2147483647 ---
+int(-1)
+--- testing: -2147483648 | 9223372036854775807 ---
+int(-1)
+--- testing: 9223372034707292160 | 0 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 | 1 ---
+int(9223372034707292161)
+--- testing: 9223372034707292160 | -1 ---
+int(-1)
+--- testing: 9223372034707292160 | 7 ---
+int(9223372034707292167)
+--- testing: 9223372034707292160 | 9 ---
+int(9223372034707292169)
+--- testing: 9223372034707292160 | 65 ---
+int(9223372034707292225)
+--- testing: 9223372034707292160 | -44 ---
+int(-44)
+--- testing: 9223372034707292160 | 2147483647 ---
+int(9223372036854775807)
+--- testing: 9223372034707292160 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -9223372034707292160 | 0 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 | 1 ---
+int(-9223372034707292159)
+--- testing: -9223372034707292160 | -1 ---
+int(-1)
+--- testing: -9223372034707292160 | 7 ---
+int(-9223372034707292153)
+--- testing: -9223372034707292160 | 9 ---
+int(-9223372034707292151)
+--- testing: -9223372034707292160 | 65 ---
+int(-9223372034707292095)
+--- testing: -9223372034707292160 | -44 ---
+int(-44)
+--- testing: -9223372034707292160 | 2147483647 ---
+int(-9223372032559808513)
+--- testing: -9223372034707292160 | 9223372036854775807 ---
+int(-1)
+--- testing: 2147483648 | 0 ---
+int(2147483648)
+--- testing: 2147483648 | 1 ---
+int(2147483649)
+--- testing: 2147483648 | -1 ---
+int(-1)
+--- testing: 2147483648 | 7 ---
+int(2147483655)
+--- testing: 2147483648 | 9 ---
+int(2147483657)
+--- testing: 2147483648 | 65 ---
+int(2147483713)
+--- testing: 2147483648 | -44 ---
+int(-44)
+--- testing: 2147483648 | 2147483647 ---
+int(4294967295)
+--- testing: 2147483648 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -2147483649 | 0 ---
+int(-2147483649)
+--- testing: -2147483649 | 1 ---
+int(-2147483649)
+--- testing: -2147483649 | -1 ---
+int(-1)
+--- testing: -2147483649 | 7 ---
+int(-2147483649)
+--- testing: -2147483649 | 9 ---
+int(-2147483649)
+--- testing: -2147483649 | 65 ---
+int(-2147483649)
+--- testing: -2147483649 | -44 ---
+int(-1)
+--- testing: -2147483649 | 2147483647 ---
+int(-2147483649)
+--- testing: -2147483649 | 9223372036854775807 ---
+int(-1)
+--- testing: 4294967294 | 0 ---
+int(4294967294)
+--- testing: 4294967294 | 1 ---
+int(4294967295)
+--- testing: 4294967294 | -1 ---
+int(-1)
+--- testing: 4294967294 | 7 ---
+int(4294967295)
+--- testing: 4294967294 | 9 ---
+int(4294967295)
+--- testing: 4294967294 | 65 ---
+int(4294967295)
+--- testing: 4294967294 | -44 ---
+int(-2)
+--- testing: 4294967294 | 2147483647 ---
+int(4294967295)
+--- testing: 4294967294 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 4294967295 | 0 ---
+int(4294967295)
+--- testing: 4294967295 | 1 ---
+int(4294967295)
+--- testing: 4294967295 | -1 ---
+int(-1)
+--- testing: 4294967295 | 7 ---
+int(4294967295)
+--- testing: 4294967295 | 9 ---
+int(4294967295)
+--- testing: 4294967295 | 65 ---
+int(4294967295)
+--- testing: 4294967295 | -44 ---
+int(-1)
+--- testing: 4294967295 | 2147483647 ---
+int(4294967295)
+--- testing: 4294967295 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 4294967293 | 0 ---
+int(4294967293)
+--- testing: 4294967293 | 1 ---
+int(4294967293)
+--- testing: 4294967293 | -1 ---
+int(-1)
+--- testing: 4294967293 | 7 ---
+int(4294967295)
+--- testing: 4294967293 | 9 ---
+int(4294967293)
+--- testing: 4294967293 | 65 ---
+int(4294967293)
+--- testing: 4294967293 | -44 ---
+int(-3)
+--- testing: 4294967293 | 2147483647 ---
+int(4294967295)
+--- testing: 4294967293 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 | 0 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 | 1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 | -1 ---
+int(-1)
+--- testing: 9223372036854775806 | 7 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 | 9 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 | 65 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 | -44 ---
+int(-2)
+--- testing: 9223372036854775806 | 2147483647 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 9.2233720368548E+18 | 0 ---
+int(-9223372036854775808)
+--- testing: 9.2233720368548E+18 | 1 ---
+int(-9223372036854775807)
+--- testing: 9.2233720368548E+18 | -1 ---
+int(-1)
+--- testing: 9.2233720368548E+18 | 7 ---
+int(-9223372036854775801)
+--- testing: 9.2233720368548E+18 | 9 ---
+int(-9223372036854775799)
+--- testing: 9.2233720368548E+18 | 65 ---
+int(-9223372036854775743)
+--- testing: 9.2233720368548E+18 | -44 ---
+int(-44)
+--- testing: 9.2233720368548E+18 | 2147483647 ---
+int(-9223372034707292161)
+--- testing: 9.2233720368548E+18 | 9223372036854775807 ---
+int(-1)
+--- testing: -9223372036854775807 | 0 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 | 1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 | -1 ---
+int(-1)
+--- testing: -9223372036854775807 | 7 ---
+int(-9223372036854775801)
+--- testing: -9223372036854775807 | 9 ---
+int(-9223372036854775799)
+--- testing: -9223372036854775807 | 65 ---
+int(-9223372036854775743)
+--- testing: -9223372036854775807 | -44 ---
+int(-43)
+--- testing: -9223372036854775807 | 2147483647 ---
+int(-9223372034707292161)
+--- testing: -9223372036854775807 | 9223372036854775807 ---
+int(-1)
+--- testing: -9.2233720368548E+18 | 0 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 | 1 ---
+int(-9223372036854775807)
+--- testing: -9.2233720368548E+18 | -1 ---
+int(-1)
+--- testing: -9.2233720368548E+18 | 7 ---
+int(-9223372036854775801)
+--- testing: -9.2233720368548E+18 | 9 ---
+int(-9223372036854775799)
+--- testing: -9.2233720368548E+18 | 65 ---
+int(-9223372036854775743)
+--- testing: -9.2233720368548E+18 | -44 ---
+int(-44)
+--- testing: -9.2233720368548E+18 | 2147483647 ---
+int(-9223372034707292161)
+--- testing: -9.2233720368548E+18 | 9223372036854775807 ---
+int(-1)
+--- testing: 0 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 0 | -9223372036854775808 ---
+int(-9223372036854775808)
+--- testing: 0 | 2147483647 ---
+int(2147483647)
+--- testing: 0 | -2147483648 ---
+int(-2147483648)
+--- testing: 0 | 9223372034707292160 ---
+int(9223372034707292160)
+--- testing: 0 | -9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: 0 | 2147483648 ---
+int(2147483648)
+--- testing: 0 | -2147483649 ---
+int(-2147483649)
+--- testing: 0 | 4294967294 ---
+int(4294967294)
+--- testing: 0 | 4294967295 ---
+int(4294967295)
+--- testing: 0 | 4294967293 ---
+int(4294967293)
+--- testing: 0 | 9223372036854775806 ---
+int(9223372036854775806)
+--- testing: 0 | 9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: 0 | -9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: 0 | -9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: 1 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 1 | -9223372036854775808 ---
+int(-9223372036854775807)
+--- testing: 1 | 2147483647 ---
+int(2147483647)
+--- testing: 1 | -2147483648 ---
+int(-2147483647)
+--- testing: 1 | 9223372034707292160 ---
+int(9223372034707292161)
+--- testing: 1 | -9223372034707292160 ---
+int(-9223372034707292159)
+--- testing: 1 | 2147483648 ---
+int(2147483649)
+--- testing: 1 | -2147483649 ---
+int(-2147483649)
+--- testing: 1 | 4294967294 ---
+int(4294967295)
+--- testing: 1 | 4294967295 ---
+int(4294967295)
+--- testing: 1 | 4294967293 ---
+int(4294967293)
+--- testing: 1 | 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 1 | 9.2233720368548E+18 ---
+int(-9223372036854775807)
+--- testing: 1 | -9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: 1 | -9.2233720368548E+18 ---
+int(-9223372036854775807)
+--- testing: -1 | 9223372036854775807 ---
+int(-1)
+--- testing: -1 | -9223372036854775808 ---
+int(-1)
+--- testing: -1 | 2147483647 ---
+int(-1)
+--- testing: -1 | -2147483648 ---
+int(-1)
+--- testing: -1 | 9223372034707292160 ---
+int(-1)
+--- testing: -1 | -9223372034707292160 ---
+int(-1)
+--- testing: -1 | 2147483648 ---
+int(-1)
+--- testing: -1 | -2147483649 ---
+int(-1)
+--- testing: -1 | 4294967294 ---
+int(-1)
+--- testing: -1 | 4294967295 ---
+int(-1)
+--- testing: -1 | 4294967293 ---
+int(-1)
+--- testing: -1 | 9223372036854775806 ---
+int(-1)
+--- testing: -1 | 9.2233720368548E+18 ---
+int(-1)
+--- testing: -1 | -9223372036854775807 ---
+int(-1)
+--- testing: -1 | -9.2233720368548E+18 ---
+int(-1)
+--- testing: 7 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 7 | -9223372036854775808 ---
+int(-9223372036854775801)
+--- testing: 7 | 2147483647 ---
+int(2147483647)
+--- testing: 7 | -2147483648 ---
+int(-2147483641)
+--- testing: 7 | 9223372034707292160 ---
+int(9223372034707292167)
+--- testing: 7 | -9223372034707292160 ---
+int(-9223372034707292153)
+--- testing: 7 | 2147483648 ---
+int(2147483655)
+--- testing: 7 | -2147483649 ---
+int(-2147483649)
+--- testing: 7 | 4294967294 ---
+int(4294967295)
+--- testing: 7 | 4294967295 ---
+int(4294967295)
+--- testing: 7 | 4294967293 ---
+int(4294967295)
+--- testing: 7 | 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 7 | 9.2233720368548E+18 ---
+int(-9223372036854775801)
+--- testing: 7 | -9223372036854775807 ---
+int(-9223372036854775801)
+--- testing: 7 | -9.2233720368548E+18 ---
+int(-9223372036854775801)
+--- testing: 9 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 9 | -9223372036854775808 ---
+int(-9223372036854775799)
+--- testing: 9 | 2147483647 ---
+int(2147483647)
+--- testing: 9 | -2147483648 ---
+int(-2147483639)
+--- testing: 9 | 9223372034707292160 ---
+int(9223372034707292169)
+--- testing: 9 | -9223372034707292160 ---
+int(-9223372034707292151)
+--- testing: 9 | 2147483648 ---
+int(2147483657)
+--- testing: 9 | -2147483649 ---
+int(-2147483649)
+--- testing: 9 | 4294967294 ---
+int(4294967295)
+--- testing: 9 | 4294967295 ---
+int(4294967295)
+--- testing: 9 | 4294967293 ---
+int(4294967293)
+--- testing: 9 | 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 9 | 9.2233720368548E+18 ---
+int(-9223372036854775799)
+--- testing: 9 | -9223372036854775807 ---
+int(-9223372036854775799)
+--- testing: 9 | -9.2233720368548E+18 ---
+int(-9223372036854775799)
+--- testing: 65 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 65 | -9223372036854775808 ---
+int(-9223372036854775743)
+--- testing: 65 | 2147483647 ---
+int(2147483647)
+--- testing: 65 | -2147483648 ---
+int(-2147483583)
+--- testing: 65 | 9223372034707292160 ---
+int(9223372034707292225)
+--- testing: 65 | -9223372034707292160 ---
+int(-9223372034707292095)
+--- testing: 65 | 2147483648 ---
+int(2147483713)
+--- testing: 65 | -2147483649 ---
+int(-2147483649)
+--- testing: 65 | 4294967294 ---
+int(4294967295)
+--- testing: 65 | 4294967295 ---
+int(4294967295)
+--- testing: 65 | 4294967293 ---
+int(4294967293)
+--- testing: 65 | 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 65 | 9.2233720368548E+18 ---
+int(-9223372036854775743)
+--- testing: 65 | -9223372036854775807 ---
+int(-9223372036854775743)
+--- testing: 65 | -9.2233720368548E+18 ---
+int(-9223372036854775743)
+--- testing: -44 | 9223372036854775807 ---
+int(-1)
+--- testing: -44 | -9223372036854775808 ---
+int(-44)
+--- testing: -44 | 2147483647 ---
+int(-1)
+--- testing: -44 | -2147483648 ---
+int(-44)
+--- testing: -44 | 9223372034707292160 ---
+int(-44)
+--- testing: -44 | -9223372034707292160 ---
+int(-44)
+--- testing: -44 | 2147483648 ---
+int(-44)
+--- testing: -44 | -2147483649 ---
+int(-1)
+--- testing: -44 | 4294967294 ---
+int(-2)
+--- testing: -44 | 4294967295 ---
+int(-1)
+--- testing: -44 | 4294967293 ---
+int(-3)
+--- testing: -44 | 9223372036854775806 ---
+int(-2)
+--- testing: -44 | 9.2233720368548E+18 ---
+int(-44)
+--- testing: -44 | -9223372036854775807 ---
+int(-43)
+--- testing: -44 | -9.2233720368548E+18 ---
+int(-44)
+--- testing: 2147483647 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 2147483647 | -9223372036854775808 ---
+int(-9223372034707292161)
+--- testing: 2147483647 | 2147483647 ---
+int(2147483647)
+--- testing: 2147483647 | -2147483648 ---
+int(-1)
+--- testing: 2147483647 | 9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 2147483647 | -9223372034707292160 ---
+int(-9223372032559808513)
+--- testing: 2147483647 | 2147483648 ---
+int(4294967295)
+--- testing: 2147483647 | -2147483649 ---
+int(-2147483649)
+--- testing: 2147483647 | 4294967294 ---
+int(4294967295)
+--- testing: 2147483647 | 4294967295 ---
+int(4294967295)
+--- testing: 2147483647 | 4294967293 ---
+int(4294967295)
+--- testing: 2147483647 | 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 2147483647 | 9.2233720368548E+18 ---
+int(-9223372034707292161)
+--- testing: 2147483647 | -9223372036854775807 ---
+int(-9223372034707292161)
+--- testing: 2147483647 | -9.2233720368548E+18 ---
+int(-9223372034707292161)
+--- testing: 9223372036854775807 | 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | -9223372036854775808 ---
+int(-1)
+--- testing: 9223372036854775807 | 2147483647 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | -2147483648 ---
+int(-1)
+--- testing: 9223372036854775807 | 9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | -9223372034707292160 ---
+int(-1)
+--- testing: 9223372036854775807 | 2147483648 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | -2147483649 ---
+int(-1)
+--- testing: 9223372036854775807 | 4294967294 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 4294967295 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 4294967293 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 | 9.2233720368548E+18 ---
+int(-1)
+--- testing: 9223372036854775807 | -9223372036854775807 ---
+int(-1)
+--- testing: 9223372036854775807 | -9.2233720368548E+18 ---
+int(-1)
+===DONE===
+ \ No newline at end of file
diff --git a/tests/lang/operators/bitwiseOr_variationStr.phpt b/tests/lang/operators/bitwiseOr_variationStr.phpt
new file mode 100644
index 0000000..6c31477
--- /dev/null
+++ b/tests/lang/operators/bitwiseOr_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test | operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' | '$otherVal' ---\n";
+ var_dump(bin2hex($strVal|$otherVal));
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' | '0' ---
+string(2) "30"
+--- testing: '0' | '65' ---
+string(4) "3635"
+--- testing: '0' | '-44' ---
+string(6) "3d3434"
+--- testing: '0' | '1.2' ---
+string(6) "312e32"
+--- testing: '0' | '-7.7' ---
+string(8) "3d372e37"
+--- testing: '0' | 'abc' ---
+string(6) "716263"
+--- testing: '0' | '123abc' ---
+string(12) "313233616263"
+--- testing: '0' | '123e5' ---
+string(10) "3132336535"
+--- testing: '0' | '123e5xyz' ---
+string(16) "313233653578797a"
+--- testing: '0' | ' 123abc' ---
+string(14) "30313233616263"
+--- testing: '0' | '123 abc' ---
+string(14) "31323320616263"
+--- testing: '0' | '123abc ' ---
+string(14) "31323361626320"
+--- testing: '0' | '3.4a' ---
+string(8) "332e3461"
+--- testing: '0' | 'a5.9' ---
+string(8) "71352e39"
+--- testing: '65' | '0' ---
+string(4) "3635"
+--- testing: '65' | '65' ---
+string(4) "3635"
+--- testing: '65' | '-44' ---
+string(6) "3f3534"
+--- testing: '65' | '1.2' ---
+string(6) "373f32"
+--- testing: '65' | '-7.7' ---
+string(8) "3f372e37"
+--- testing: '65' | 'abc' ---
+string(6) "777763"
+--- testing: '65' | '123abc' ---
+string(12) "373733616263"
+--- testing: '65' | '123e5' ---
+string(10) "3737336535"
+--- testing: '65' | '123e5xyz' ---
+string(16) "373733653578797a"
+--- testing: '65' | ' 123abc' ---
+string(14) "36353233616263"
+--- testing: '65' | '123 abc' ---
+string(14) "37373320616263"
+--- testing: '65' | '123abc ' ---
+string(14) "37373361626320"
+--- testing: '65' | '3.4a' ---
+string(8) "373f3461"
+--- testing: '65' | 'a5.9' ---
+string(8) "77352e39"
+--- testing: '-44' | '0' ---
+string(6) "3d3434"
+--- testing: '-44' | '65' ---
+string(6) "3f3534"
+--- testing: '-44' | '-44' ---
+string(6) "2d3434"
+--- testing: '-44' | '1.2' ---
+string(6) "3d3e36"
+--- testing: '-44' | '-7.7' ---
+string(8) "2d373e37"
+--- testing: '-44' | 'abc' ---
+string(6) "6d7677"
+--- testing: '-44' | '123abc' ---
+string(12) "3d3637616263"
+--- testing: '-44' | '123e5' ---
+string(10) "3d36376535"
+--- testing: '-44' | '123e5xyz' ---
+string(16) "3d3637653578797a"
+--- testing: '-44' | ' 123abc' ---
+string(14) "2d353633616263"
+--- testing: '-44' | '123 abc' ---
+string(14) "3d363720616263"
+--- testing: '-44' | '123abc ' ---
+string(14) "3d363761626320"
+--- testing: '-44' | '3.4a' ---
+string(8) "3f3e3461"
+--- testing: '-44' | 'a5.9' ---
+string(8) "6d353e39"
+--- testing: '1.2' | '0' ---
+string(6) "312e32"
+--- testing: '1.2' | '65' ---
+string(6) "373f32"
+--- testing: '1.2' | '-44' ---
+string(6) "3d3e36"
+--- testing: '1.2' | '1.2' ---
+string(6) "312e32"
+--- testing: '1.2' | '-7.7' ---
+string(8) "3d3f3e37"
+--- testing: '1.2' | 'abc' ---
+string(6) "716e73"
+--- testing: '1.2' | '123abc' ---
+string(12) "313e33616263"
+--- testing: '1.2' | '123e5' ---
+string(10) "313e336535"
+--- testing: '1.2' | '123e5xyz' ---
+string(16) "313e33653578797a"
+--- testing: '1.2' | ' 123abc' ---
+string(14) "313f3233616263"
+--- testing: '1.2' | '123 abc' ---
+string(14) "313e3320616263"
+--- testing: '1.2' | '123abc ' ---
+string(14) "313e3361626320"
+--- testing: '1.2' | '3.4a' ---
+string(8) "332e3661"
+--- testing: '1.2' | 'a5.9' ---
+string(8) "713f3e39"
+--- testing: '-7.7' | '0' ---
+string(8) "3d372e37"
+--- testing: '-7.7' | '65' ---
+string(8) "3f372e37"
+--- testing: '-7.7' | '-44' ---
+string(8) "2d373e37"
+--- testing: '-7.7' | '1.2' ---
+string(8) "3d3f3e37"
+--- testing: '-7.7' | '-7.7' ---
+string(8) "2d372e37"
+--- testing: '-7.7' | 'abc' ---
+string(8) "6d776f37"
+--- testing: '-7.7' | '123abc' ---
+string(12) "3d373f776263"
+--- testing: '-7.7' | '123e5' ---
+string(10) "3d373f7735"
+--- testing: '-7.7' | '123e5xyz' ---
+string(16) "3d373f773578797a"
+--- testing: '-7.7' | ' 123abc' ---
+string(14) "2d373e37616263"
+--- testing: '-7.7' | '123 abc' ---
+string(14) "3d373f37616263"
+--- testing: '-7.7' | '123abc ' ---
+string(14) "3d373f77626320"
+--- testing: '-7.7' | '3.4a' ---
+string(8) "3f3f3e77"
+--- testing: '-7.7' | 'a5.9' ---
+string(8) "6d372e3f"
+--- testing: 'abc' | '0' ---
+string(6) "716263"
+--- testing: 'abc' | '65' ---
+string(6) "777763"
+--- testing: 'abc' | '-44' ---
+string(6) "6d7677"
+--- testing: 'abc' | '1.2' ---
+string(6) "716e73"
+--- testing: 'abc' | '-7.7' ---
+string(8) "6d776f37"
+--- testing: 'abc' | 'abc' ---
+string(6) "616263"
+--- testing: 'abc' | '123abc' ---
+string(12) "717273616263"
+--- testing: 'abc' | '123e5' ---
+string(10) "7172736535"
+--- testing: 'abc' | '123e5xyz' ---
+string(16) "717273653578797a"
+--- testing: 'abc' | ' 123abc' ---
+string(14) "61737333616263"
+--- testing: 'abc' | '123 abc' ---
+string(14) "71727320616263"
+--- testing: 'abc' | '123abc ' ---
+string(14) "71727361626320"
+--- testing: 'abc' | '3.4a' ---
+string(8) "736e7761"
+--- testing: 'abc' | 'a5.9' ---
+string(8) "61776f39"
+--- testing: '123abc' | '0' ---
+string(12) "313233616263"
+--- testing: '123abc' | '65' ---
+string(12) "373733616263"
+--- testing: '123abc' | '-44' ---
+string(12) "3d3637616263"
+--- testing: '123abc' | '1.2' ---
+string(12) "313e33616263"
+--- testing: '123abc' | '-7.7' ---
+string(12) "3d373f776263"
+--- testing: '123abc' | 'abc' ---
+string(12) "717273616263"
+--- testing: '123abc' | '123abc' ---
+string(12) "313233616263"
+--- testing: '123abc' | '123e5' ---
+string(12) "313233657763"
+--- testing: '123abc' | '123e5xyz' ---
+string(16) "31323365777b797a"
+--- testing: '123abc' | ' 123abc' ---
+string(14) "31333373636363"
+--- testing: '123abc' | '123 abc' ---
+string(14) "31323361636363"
+--- testing: '123abc' | '123abc ' ---
+string(14) "31323361626320"
+--- testing: '123abc' | '3.4a' ---
+string(12) "333e37616263"
+--- testing: '123abc' | 'a5.9' ---
+string(12) "71373f796263"
+--- testing: '123e5' | '0' ---
+string(10) "3132336535"
+--- testing: '123e5' | '65' ---
+string(10) "3737336535"
+--- testing: '123e5' | '-44' ---
+string(10) "3d36376535"
+--- testing: '123e5' | '1.2' ---
+string(10) "313e336535"
+--- testing: '123e5' | '-7.7' ---
+string(10) "3d373f7735"
+--- testing: '123e5' | 'abc' ---
+string(10) "7172736535"
+--- testing: '123e5' | '123abc' ---
+string(12) "313233657763"
+--- testing: '123e5' | '123e5' ---
+string(10) "3132336535"
+--- testing: '123e5' | '123e5xyz' ---
+string(16) "313233653578797a"
+--- testing: '123e5' | ' 123abc' ---
+string(14) "31333377756263"
+--- testing: '123e5' | '123 abc' ---
+string(14) "31323365756263"
+--- testing: '123e5' | '123abc ' ---
+string(14) "31323365776320"
+--- testing: '123e5' | '3.4a' ---
+string(10) "333e376535"
+--- testing: '123e5' | 'a5.9' ---
+string(10) "71373f7d35"
+--- testing: '123e5xyz' | '0' ---
+string(16) "313233653578797a"
+--- testing: '123e5xyz' | '65' ---
+string(16) "373733653578797a"
+--- testing: '123e5xyz' | '-44' ---
+string(16) "3d3637653578797a"
+--- testing: '123e5xyz' | '1.2' ---
+string(16) "313e33653578797a"
+--- testing: '123e5xyz' | '-7.7' ---
+string(16) "3d373f773578797a"
+--- testing: '123e5xyz' | 'abc' ---
+string(16) "717273653578797a"
+--- testing: '123e5xyz' | '123abc' ---
+string(16) "31323365777b797a"
+--- testing: '123e5xyz' | '123e5' ---
+string(16) "313233653578797a"
+--- testing: '123e5xyz' | '123e5xyz' ---
+string(16) "313233653578797a"
+--- testing: '123e5xyz' | ' 123abc' ---
+string(16) "31333377757a7b7a"
+--- testing: '123e5xyz' | '123 abc' ---
+string(16) "31323365757a7b7a"
+--- testing: '123e5xyz' | '123abc ' ---
+string(16) "31323365777b797a"
+--- testing: '123e5xyz' | '3.4a' ---
+string(16) "333e37653578797a"
+--- testing: '123e5xyz' | 'a5.9' ---
+string(16) "71373f7d3578797a"
+--- testing: ' 123abc' | '0' ---
+string(14) "30313233616263"
+--- testing: ' 123abc' | '65' ---
+string(14) "36353233616263"
+--- testing: ' 123abc' | '-44' ---
+string(14) "2d353633616263"
+--- testing: ' 123abc' | '1.2' ---
+string(14) "313f3233616263"
+--- testing: ' 123abc' | '-7.7' ---
+string(14) "2d373e37616263"
+--- testing: ' 123abc' | 'abc' ---
+string(14) "61737333616263"
+--- testing: ' 123abc' | '123abc' ---
+string(14) "31333373636363"
+--- testing: ' 123abc' | '123e5' ---
+string(14) "31333377756263"
+--- testing: ' 123abc' | '123e5xyz' ---
+string(16) "31333377757a7b7a"
+--- testing: ' 123abc' | ' 123abc' ---
+string(14) "20313233616263"
+--- testing: ' 123abc' | '123 abc' ---
+string(14) "31333333616263"
+--- testing: ' 123abc' | '123abc ' ---
+string(14) "31333373636363"
+--- testing: ' 123abc' | '3.4a' ---
+string(14) "333f3673616263"
+--- testing: ' 123abc' | 'a5.9' ---
+string(14) "61353e3b616263"
+--- testing: '123 abc' | '0' ---
+string(14) "31323320616263"
+--- testing: '123 abc' | '65' ---
+string(14) "37373320616263"
+--- testing: '123 abc' | '-44' ---
+string(14) "3d363720616263"
+--- testing: '123 abc' | '1.2' ---
+string(14) "313e3320616263"
+--- testing: '123 abc' | '-7.7' ---
+string(14) "3d373f37616263"
+--- testing: '123 abc' | 'abc' ---
+string(14) "71727320616263"
+--- testing: '123 abc' | '123abc' ---
+string(14) "31323361636363"
+--- testing: '123 abc' | '123e5' ---
+string(14) "31323365756263"
+--- testing: '123 abc' | '123e5xyz' ---
+string(16) "31323365757a7b7a"
+--- testing: '123 abc' | ' 123abc' ---
+string(14) "31333333616263"
+--- testing: '123 abc' | '123 abc' ---
+string(14) "31323320616263"
+--- testing: '123 abc' | '123abc ' ---
+string(14) "31323361636363"
+--- testing: '123 abc' | '3.4a' ---
+string(14) "333e3761616263"
+--- testing: '123 abc' | 'a5.9' ---
+string(14) "71373f39616263"
+--- testing: '123abc ' | '0' ---
+string(14) "31323361626320"
+--- testing: '123abc ' | '65' ---
+string(14) "37373361626320"
+--- testing: '123abc ' | '-44' ---
+string(14) "3d363761626320"
+--- testing: '123abc ' | '1.2' ---
+string(14) "313e3361626320"
+--- testing: '123abc ' | '-7.7' ---
+string(14) "3d373f77626320"
+--- testing: '123abc ' | 'abc' ---
+string(14) "71727361626320"
+--- testing: '123abc ' | '123abc' ---
+string(14) "31323361626320"
+--- testing: '123abc ' | '123e5' ---
+string(14) "31323365776320"
+--- testing: '123abc ' | '123e5xyz' ---
+string(16) "31323365777b797a"
+--- testing: '123abc ' | ' 123abc' ---
+string(14) "31333373636363"
+--- testing: '123abc ' | '123 abc' ---
+string(14) "31323361636363"
+--- testing: '123abc ' | '123abc ' ---
+string(14) "31323361626320"
+--- testing: '123abc ' | '3.4a' ---
+string(14) "333e3761626320"
+--- testing: '123abc ' | 'a5.9' ---
+string(14) "71373f79626320"
+--- testing: '3.4a' | '0' ---
+string(8) "332e3461"
+--- testing: '3.4a' | '65' ---
+string(8) "373f3461"
+--- testing: '3.4a' | '-44' ---
+string(8) "3f3e3461"
+--- testing: '3.4a' | '1.2' ---
+string(8) "332e3661"
+--- testing: '3.4a' | '-7.7' ---
+string(8) "3f3f3e77"
+--- testing: '3.4a' | 'abc' ---
+string(8) "736e7761"
+--- testing: '3.4a' | '123abc' ---
+string(12) "333e37616263"
+--- testing: '3.4a' | '123e5' ---
+string(10) "333e376535"
+--- testing: '3.4a' | '123e5xyz' ---
+string(16) "333e37653578797a"
+--- testing: '3.4a' | ' 123abc' ---
+string(14) "333f3673616263"
+--- testing: '3.4a' | '123 abc' ---
+string(14) "333e3761616263"
+--- testing: '3.4a' | '123abc ' ---
+string(14) "333e3761626320"
+--- testing: '3.4a' | '3.4a' ---
+string(8) "332e3461"
+--- testing: '3.4a' | 'a5.9' ---
+string(8) "733f3e79"
+--- testing: 'a5.9' | '0' ---
+string(8) "71352e39"
+--- testing: 'a5.9' | '65' ---
+string(8) "77352e39"
+--- testing: 'a5.9' | '-44' ---
+string(8) "6d353e39"
+--- testing: 'a5.9' | '1.2' ---
+string(8) "713f3e39"
+--- testing: 'a5.9' | '-7.7' ---
+string(8) "6d372e3f"
+--- testing: 'a5.9' | 'abc' ---
+string(8) "61776f39"
+--- testing: 'a5.9' | '123abc' ---
+string(12) "71373f796263"
+--- testing: 'a5.9' | '123e5' ---
+string(10) "71373f7d35"
+--- testing: 'a5.9' | '123e5xyz' ---
+string(16) "71373f7d3578797a"
+--- testing: 'a5.9' | ' 123abc' ---
+string(14) "61353e3b616263"
+--- testing: 'a5.9' | '123 abc' ---
+string(14) "71373f39616263"
+--- testing: 'a5.9' | '123abc ' ---
+string(14) "71373f79626320"
+--- testing: 'a5.9' | '3.4a' ---
+string(8) "733f3e79"
+--- testing: 'a5.9' | 'a5.9' ---
+string(8) "61352e39"
+===DONE===
diff --git a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt
new file mode 100644
index 0000000..24da2d0
--- /dev/null
+++ b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt
@@ -0,0 +1,583 @@
+--TEST--
+Test << operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal << $otherVal ---\n";
+ var_dump($longVal<<$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal << $longVal ---\n";
+ var_dump($otherVal<<$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 << 0 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 << 1 ---
+int(-2)
+--- testing: 9223372036854775807 << -1 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775807 << 7 ---
+int(-128)
+--- testing: 9223372036854775807 << 9 ---
+int(-512)
+--- testing: 9223372036854775807 << 65 ---
+int(-2)
+--- testing: 9223372036854775807 << -44 ---
+int(-1048576)
+--- testing: 9223372036854775807 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775807 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 << 0 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 << 1 ---
+int(0)
+--- testing: -9223372036854775808 << -1 ---
+int(0)
+--- testing: -9223372036854775808 << 7 ---
+int(0)
+--- testing: -9223372036854775808 << 9 ---
+int(0)
+--- testing: -9223372036854775808 << 65 ---
+int(0)
+--- testing: -9223372036854775808 << -44 ---
+int(0)
+--- testing: -9223372036854775808 << 2147483647 ---
+int(0)
+--- testing: -9223372036854775808 << 9223372036854775807 ---
+int(0)
+--- testing: 2147483647 << 0 ---
+int(2147483647)
+--- testing: 2147483647 << 1 ---
+int(4294967294)
+--- testing: 2147483647 << -1 ---
+int(-9223372036854775808)
+--- testing: 2147483647 << 7 ---
+int(274877906816)
+--- testing: 2147483647 << 9 ---
+int(1099511627264)
+--- testing: 2147483647 << 65 ---
+int(4294967294)
+--- testing: 2147483647 << -44 ---
+int(2251799812636672)
+--- testing: 2147483647 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 2147483647 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -2147483648 << 0 ---
+int(-2147483648)
+--- testing: -2147483648 << 1 ---
+int(-4294967296)
+--- testing: -2147483648 << -1 ---
+int(0)
+--- testing: -2147483648 << 7 ---
+int(-274877906944)
+--- testing: -2147483648 << 9 ---
+int(-1099511627776)
+--- testing: -2147483648 << 65 ---
+int(-4294967296)
+--- testing: -2147483648 << -44 ---
+int(-2251799813685248)
+--- testing: -2147483648 << 2147483647 ---
+int(0)
+--- testing: -2147483648 << 9223372036854775807 ---
+int(0)
+--- testing: 9223372034707292160 << 0 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 << 1 ---
+int(-4294967296)
+--- testing: 9223372034707292160 << -1 ---
+int(0)
+--- testing: 9223372034707292160 << 7 ---
+int(-274877906944)
+--- testing: 9223372034707292160 << 9 ---
+int(-1099511627776)
+--- testing: 9223372034707292160 << 65 ---
+int(-4294967296)
+--- testing: 9223372034707292160 << -44 ---
+int(-2251799813685248)
+--- testing: 9223372034707292160 << 2147483647 ---
+int(0)
+--- testing: 9223372034707292160 << 9223372036854775807 ---
+int(0)
+--- testing: -9223372034707292160 << 0 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 << 1 ---
+int(4294967296)
+--- testing: -9223372034707292160 << -1 ---
+int(0)
+--- testing: -9223372034707292160 << 7 ---
+int(274877906944)
+--- testing: -9223372034707292160 << 9 ---
+int(1099511627776)
+--- testing: -9223372034707292160 << 65 ---
+int(4294967296)
+--- testing: -9223372034707292160 << -44 ---
+int(2251799813685248)
+--- testing: -9223372034707292160 << 2147483647 ---
+int(0)
+--- testing: -9223372034707292160 << 9223372036854775807 ---
+int(0)
+--- testing: 2147483648 << 0 ---
+int(2147483648)
+--- testing: 2147483648 << 1 ---
+int(4294967296)
+--- testing: 2147483648 << -1 ---
+int(0)
+--- testing: 2147483648 << 7 ---
+int(274877906944)
+--- testing: 2147483648 << 9 ---
+int(1099511627776)
+--- testing: 2147483648 << 65 ---
+int(4294967296)
+--- testing: 2147483648 << -44 ---
+int(2251799813685248)
+--- testing: 2147483648 << 2147483647 ---
+int(0)
+--- testing: 2147483648 << 9223372036854775807 ---
+int(0)
+--- testing: -2147483649 << 0 ---
+int(-2147483649)
+--- testing: -2147483649 << 1 ---
+int(-4294967298)
+--- testing: -2147483649 << -1 ---
+int(-9223372036854775808)
+--- testing: -2147483649 << 7 ---
+int(-274877907072)
+--- testing: -2147483649 << 9 ---
+int(-1099511628288)
+--- testing: -2147483649 << 65 ---
+int(-4294967298)
+--- testing: -2147483649 << -44 ---
+int(-2251799814733824)
+--- testing: -2147483649 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: -2147483649 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 4294967294 << 0 ---
+int(4294967294)
+--- testing: 4294967294 << 1 ---
+int(8589934588)
+--- testing: 4294967294 << -1 ---
+int(0)
+--- testing: 4294967294 << 7 ---
+int(549755813632)
+--- testing: 4294967294 << 9 ---
+int(2199023254528)
+--- testing: 4294967294 << 65 ---
+int(8589934588)
+--- testing: 4294967294 << -44 ---
+int(4503599625273344)
+--- testing: 4294967294 << 2147483647 ---
+int(0)
+--- testing: 4294967294 << 9223372036854775807 ---
+int(0)
+--- testing: 4294967295 << 0 ---
+int(4294967295)
+--- testing: 4294967295 << 1 ---
+int(8589934590)
+--- testing: 4294967295 << -1 ---
+int(-9223372036854775808)
+--- testing: 4294967295 << 7 ---
+int(549755813760)
+--- testing: 4294967295 << 9 ---
+int(2199023255040)
+--- testing: 4294967295 << 65 ---
+int(8589934590)
+--- testing: 4294967295 << -44 ---
+int(4503599626321920)
+--- testing: 4294967295 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 4294967295 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 4294967293 << 0 ---
+int(4294967293)
+--- testing: 4294967293 << 1 ---
+int(8589934586)
+--- testing: 4294967293 << -1 ---
+int(-9223372036854775808)
+--- testing: 4294967293 << 7 ---
+int(549755813504)
+--- testing: 4294967293 << 9 ---
+int(2199023254016)
+--- testing: 4294967293 << 65 ---
+int(8589934586)
+--- testing: 4294967293 << -44 ---
+int(4503599624224768)
+--- testing: 4294967293 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 4294967293 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775806 << 0 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 << 1 ---
+int(-4)
+--- testing: 9223372036854775806 << -1 ---
+int(0)
+--- testing: 9223372036854775806 << 7 ---
+int(-256)
+--- testing: 9223372036854775806 << 9 ---
+int(-1024)
+--- testing: 9223372036854775806 << 65 ---
+int(-4)
+--- testing: 9223372036854775806 << -44 ---
+int(-2097152)
+--- testing: 9223372036854775806 << 2147483647 ---
+int(0)
+--- testing: 9223372036854775806 << 9223372036854775807 ---
+int(0)
+--- testing: 9.2233720368548E+18 << 0 ---
+int(-9223372036854775808)
+--- testing: 9.2233720368548E+18 << 1 ---
+int(0)
+--- testing: 9.2233720368548E+18 << -1 ---
+int(0)
+--- testing: 9.2233720368548E+18 << 7 ---
+int(0)
+--- testing: 9.2233720368548E+18 << 9 ---
+int(0)
+--- testing: 9.2233720368548E+18 << 65 ---
+int(0)
+--- testing: 9.2233720368548E+18 << -44 ---
+int(0)
+--- testing: 9.2233720368548E+18 << 2147483647 ---
+int(0)
+--- testing: 9.2233720368548E+18 << 9223372036854775807 ---
+int(0)
+--- testing: -9223372036854775807 << 0 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 << 1 ---
+int(2)
+--- testing: -9223372036854775807 << -1 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775807 << 7 ---
+int(128)
+--- testing: -9223372036854775807 << 9 ---
+int(512)
+--- testing: -9223372036854775807 << 65 ---
+int(2)
+--- testing: -9223372036854775807 << -44 ---
+int(1048576)
+--- testing: -9223372036854775807 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775807 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 << 0 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 << 1 ---
+int(0)
+--- testing: -9.2233720368548E+18 << -1 ---
+int(0)
+--- testing: -9.2233720368548E+18 << 7 ---
+int(0)
+--- testing: -9.2233720368548E+18 << 9 ---
+int(0)
+--- testing: -9.2233720368548E+18 << 65 ---
+int(0)
+--- testing: -9.2233720368548E+18 << -44 ---
+int(0)
+--- testing: -9.2233720368548E+18 << 2147483647 ---
+int(0)
+--- testing: -9.2233720368548E+18 << 9223372036854775807 ---
+int(0)
+--- testing: 0 << 9223372036854775807 ---
+int(0)
+--- testing: 0 << -9223372036854775808 ---
+int(0)
+--- testing: 0 << 2147483647 ---
+int(0)
+--- testing: 0 << -2147483648 ---
+int(0)
+--- testing: 0 << 9223372034707292160 ---
+int(0)
+--- testing: 0 << -9223372034707292160 ---
+int(0)
+--- testing: 0 << 2147483648 ---
+int(0)
+--- testing: 0 << -2147483649 ---
+int(0)
+--- testing: 0 << 4294967294 ---
+int(0)
+--- testing: 0 << 4294967295 ---
+int(0)
+--- testing: 0 << 4294967293 ---
+int(0)
+--- testing: 0 << 9223372036854775806 ---
+int(0)
+--- testing: 0 << 9.2233720368548E+18 ---
+int(0)
+--- testing: 0 << -9223372036854775807 ---
+int(0)
+--- testing: 0 << -9.2233720368548E+18 ---
+int(0)
+--- testing: 1 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 1 << -9223372036854775808 ---
+int(1)
+--- testing: 1 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 1 << -2147483648 ---
+int(1)
+--- testing: 1 << 9223372034707292160 ---
+int(1)
+--- testing: 1 << -9223372034707292160 ---
+int(1)
+--- testing: 1 << 2147483648 ---
+int(1)
+--- testing: 1 << -2147483649 ---
+int(-9223372036854775808)
+--- testing: 1 << 4294967294 ---
+int(4611686018427387904)
+--- testing: 1 << 4294967295 ---
+int(-9223372036854775808)
+--- testing: 1 << 4294967293 ---
+int(2305843009213693952)
+--- testing: 1 << 9223372036854775806 ---
+int(4611686018427387904)
+--- testing: 1 << 9.2233720368548E+18 ---
+int(1)
+--- testing: 1 << -9223372036854775807 ---
+int(2)
+--- testing: 1 << -9.2233720368548E+18 ---
+int(1)
+--- testing: -1 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -1 << -9223372036854775808 ---
+int(-1)
+--- testing: -1 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: -1 << -2147483648 ---
+int(-1)
+--- testing: -1 << 9223372034707292160 ---
+int(-1)
+--- testing: -1 << -9223372034707292160 ---
+int(-1)
+--- testing: -1 << 2147483648 ---
+int(-1)
+--- testing: -1 << -2147483649 ---
+int(-9223372036854775808)
+--- testing: -1 << 4294967294 ---
+int(-4611686018427387904)
+--- testing: -1 << 4294967295 ---
+int(-9223372036854775808)
+--- testing: -1 << 4294967293 ---
+int(-2305843009213693952)
+--- testing: -1 << 9223372036854775806 ---
+int(-4611686018427387904)
+--- testing: -1 << 9.2233720368548E+18 ---
+int(-1)
+--- testing: -1 << -9223372036854775807 ---
+int(-2)
+--- testing: -1 << -9.2233720368548E+18 ---
+int(-1)
+--- testing: 7 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 7 << -9223372036854775808 ---
+int(7)
+--- testing: 7 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 7 << -2147483648 ---
+int(7)
+--- testing: 7 << 9223372034707292160 ---
+int(7)
+--- testing: 7 << -9223372034707292160 ---
+int(7)
+--- testing: 7 << 2147483648 ---
+int(7)
+--- testing: 7 << -2147483649 ---
+int(-9223372036854775808)
+--- testing: 7 << 4294967294 ---
+int(-4611686018427387904)
+--- testing: 7 << 4294967295 ---
+int(-9223372036854775808)
+--- testing: 7 << 4294967293 ---
+int(-2305843009213693952)
+--- testing: 7 << 9223372036854775806 ---
+int(-4611686018427387904)
+--- testing: 7 << 9.2233720368548E+18 ---
+int(7)
+--- testing: 7 << -9223372036854775807 ---
+int(14)
+--- testing: 7 << -9.2233720368548E+18 ---
+int(7)
+--- testing: 9 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 9 << -9223372036854775808 ---
+int(9)
+--- testing: 9 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 9 << -2147483648 ---
+int(9)
+--- testing: 9 << 9223372034707292160 ---
+int(9)
+--- testing: 9 << -9223372034707292160 ---
+int(9)
+--- testing: 9 << 2147483648 ---
+int(9)
+--- testing: 9 << -2147483649 ---
+int(-9223372036854775808)
+--- testing: 9 << 4294967294 ---
+int(4611686018427387904)
+--- testing: 9 << 4294967295 ---
+int(-9223372036854775808)
+--- testing: 9 << 4294967293 ---
+int(2305843009213693952)
+--- testing: 9 << 9223372036854775806 ---
+int(4611686018427387904)
+--- testing: 9 << 9.2233720368548E+18 ---
+int(9)
+--- testing: 9 << -9223372036854775807 ---
+int(18)
+--- testing: 9 << -9.2233720368548E+18 ---
+int(9)
+--- testing: 65 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 65 << -9223372036854775808 ---
+int(65)
+--- testing: 65 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 65 << -2147483648 ---
+int(65)
+--- testing: 65 << 9223372034707292160 ---
+int(65)
+--- testing: 65 << -9223372034707292160 ---
+int(65)
+--- testing: 65 << 2147483648 ---
+int(65)
+--- testing: 65 << -2147483649 ---
+int(-9223372036854775808)
+--- testing: 65 << 4294967294 ---
+int(4611686018427387904)
+--- testing: 65 << 4294967295 ---
+int(-9223372036854775808)
+--- testing: 65 << 4294967293 ---
+int(2305843009213693952)
+--- testing: 65 << 9223372036854775806 ---
+int(4611686018427387904)
+--- testing: 65 << 9.2233720368548E+18 ---
+int(65)
+--- testing: 65 << -9223372036854775807 ---
+int(130)
+--- testing: 65 << -9.2233720368548E+18 ---
+int(65)
+--- testing: -44 << 9223372036854775807 ---
+int(0)
+--- testing: -44 << -9223372036854775808 ---
+int(-44)
+--- testing: -44 << 2147483647 ---
+int(0)
+--- testing: -44 << -2147483648 ---
+int(-44)
+--- testing: -44 << 9223372034707292160 ---
+int(-44)
+--- testing: -44 << -9223372034707292160 ---
+int(-44)
+--- testing: -44 << 2147483648 ---
+int(-44)
+--- testing: -44 << -2147483649 ---
+int(0)
+--- testing: -44 << 4294967294 ---
+int(0)
+--- testing: -44 << 4294967295 ---
+int(0)
+--- testing: -44 << 4294967293 ---
+int(-9223372036854775808)
+--- testing: -44 << 9223372036854775806 ---
+int(0)
+--- testing: -44 << 9.2233720368548E+18 ---
+int(-44)
+--- testing: -44 << -9223372036854775807 ---
+int(-88)
+--- testing: -44 << -9.2233720368548E+18 ---
+int(-44)
+--- testing: 2147483647 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 2147483647 << -9223372036854775808 ---
+int(2147483647)
+--- testing: 2147483647 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 2147483647 << -2147483648 ---
+int(2147483647)
+--- testing: 2147483647 << 9223372034707292160 ---
+int(2147483647)
+--- testing: 2147483647 << -9223372034707292160 ---
+int(2147483647)
+--- testing: 2147483647 << 2147483648 ---
+int(2147483647)
+--- testing: 2147483647 << -2147483649 ---
+int(-9223372036854775808)
+--- testing: 2147483647 << 4294967294 ---
+int(-4611686018427387904)
+--- testing: 2147483647 << 4294967295 ---
+int(-9223372036854775808)
+--- testing: 2147483647 << 4294967293 ---
+int(-2305843009213693952)
+--- testing: 2147483647 << 9223372036854775806 ---
+int(-4611686018427387904)
+--- testing: 2147483647 << 9.2233720368548E+18 ---
+int(2147483647)
+--- testing: 2147483647 << -9223372036854775807 ---
+int(4294967294)
+--- testing: 2147483647 << -9.2233720368548E+18 ---
+int(2147483647)
+--- testing: 9223372036854775807 << 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775807 << -9223372036854775808 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 << 2147483647 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775807 << -2147483648 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 << 9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 << -9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 << 2147483648 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 << -2147483649 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775807 << 4294967294 ---
+int(-4611686018427387904)
+--- testing: 9223372036854775807 << 4294967295 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775807 << 4294967293 ---
+int(-2305843009213693952)
+--- testing: 9223372036854775807 << 9223372036854775806 ---
+int(-4611686018427387904)
+--- testing: 9223372036854775807 << 9.2233720368548E+18 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 << -9223372036854775807 ---
+int(-2)
+--- testing: 9223372036854775807 << -9.2233720368548E+18 ---
+int(9223372036854775807)
+===DONE===
+ \ No newline at end of file
diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt
new file mode 100644
index 0000000..b1bc437
--- /dev/null
+++ b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt
@@ -0,0 +1,421 @@
+--TEST--
+Test << operator : various numbers as strings
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' << '$otherVal' ---\n";
+ var_dump(bin2hex($strVal<<$otherVal));
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' << '0' ---
+string(2) "30"
+--- testing: '0' << '65' ---
+string(2) "30"
+--- testing: '0' << '-44' ---
+string(2) "30"
+--- testing: '0' << '1.2' ---
+string(2) "30"
+--- testing: '0' << '-7.7' ---
+string(2) "30"
+--- testing: '0' << 'abc' ---
+string(2) "30"
+--- testing: '0' << '123abc' ---
+string(2) "30"
+--- testing: '0' << '123e5' ---
+string(2) "30"
+--- testing: '0' << '123e5xyz' ---
+string(2) "30"
+--- testing: '0' << ' 123abc' ---
+string(2) "30"
+--- testing: '0' << '123 abc' ---
+string(2) "30"
+--- testing: '0' << '123abc ' ---
+string(2) "30"
+--- testing: '0' << '3.4a' ---
+string(2) "30"
+--- testing: '0' << 'a5.9' ---
+string(2) "30"
+--- testing: '65' << '0' ---
+string(4) "3635"
+--- testing: '65' << '65' ---
+string(6) "313330"
+--- testing: '65' << '-44' ---
+string(16) "3638313537343430"
+--- testing: '65' << '1.2' ---
+string(6) "313330"
+--- testing: '65' << '-7.7' ---
+string(22) "2d32313133393239323136"
+--- testing: '65' << 'abc' ---
+string(4) "3635"
+--- testing: '65' << '123abc' ---
+string(18) "313334323137373238"
+--- testing: '65' << '123e5' ---
+string(18) "313334323137373238"
+--- testing: '65' << '123e5xyz' ---
+string(18) "313334323137373238"
+--- testing: '65' << ' 123abc' ---
+string(18) "313334323137373238"
+--- testing: '65' << '123 abc' ---
+string(18) "313334323137373238"
+--- testing: '65' << '123abc ' ---
+string(18) "313334323137373238"
+--- testing: '65' << '3.4a' ---
+string(6) "353230"
+--- testing: '65' << 'a5.9' ---
+string(4) "3635"
+--- testing: '-44' << '0' ---
+string(6) "2d3434"
+--- testing: '-44' << '65' ---
+string(6) "2d3838"
+--- testing: '-44' << '-44' ---
+string(18) "2d3436313337333434"
+--- testing: '-44' << '1.2' ---
+string(6) "2d3838"
+--- testing: '-44' << '-7.7' ---
+string(22) "2d31343736333935303038"
+--- testing: '-44' << 'abc' ---
+string(6) "2d3434"
+--- testing: '-44' << '123abc' ---
+string(22) "2d31363130363132373336"
+--- testing: '-44' << '123e5' ---
+string(22) "2d31363130363132373336"
+--- testing: '-44' << '123e5xyz' ---
+string(22) "2d31363130363132373336"
+--- testing: '-44' << ' 123abc' ---
+string(22) "2d31363130363132373336"
+--- testing: '-44' << '123 abc' ---
+string(22) "2d31363130363132373336"
+--- testing: '-44' << '123abc ' ---
+string(22) "2d31363130363132373336"
+--- testing: '-44' << '3.4a' ---
+string(8) "2d333532"
+--- testing: '-44' << 'a5.9' ---
+string(6) "2d3434"
+--- testing: '1.2' << '0' ---
+string(2) "31"
+--- testing: '1.2' << '65' ---
+string(2) "32"
+--- testing: '1.2' << '-44' ---
+string(14) "31303438353736"
+--- testing: '1.2' << '1.2' ---
+string(2) "32"
+--- testing: '1.2' << '-7.7' ---
+string(16) "3333353534343332"
+--- testing: '1.2' << 'abc' ---
+string(2) "31"
+--- testing: '1.2' << '123abc' ---
+string(18) "313334323137373238"
+--- testing: '1.2' << '123e5' ---
+string(18) "313334323137373238"
+--- testing: '1.2' << '123e5xyz' ---
+string(18) "313334323137373238"
+--- testing: '1.2' << ' 123abc' ---
+string(18) "313334323137373238"
+--- testing: '1.2' << '123 abc' ---
+string(18) "313334323137373238"
+--- testing: '1.2' << '123abc ' ---
+string(18) "313334323137373238"
+--- testing: '1.2' << '3.4a' ---
+string(2) "38"
+--- testing: '1.2' << 'a5.9' ---
+string(2) "31"
+--- testing: '-7.7' << '0' ---
+string(4) "2d37"
+--- testing: '-7.7' << '65' ---
+string(6) "2d3134"
+--- testing: '-7.7' << '-44' ---
+string(16) "2d37333430303332"
+--- testing: '-7.7' << '1.2' ---
+string(6) "2d3134"
+--- testing: '-7.7' << '-7.7' ---
+string(20) "2d323334383831303234"
+--- testing: '-7.7' << 'abc' ---
+string(4) "2d37"
+--- testing: '-7.7' << '123abc' ---
+string(20) "2d393339353234303936"
+--- testing: '-7.7' << '123e5' ---
+string(20) "2d393339353234303936"
+--- testing: '-7.7' << '123e5xyz' ---
+string(20) "2d393339353234303936"
+--- testing: '-7.7' << ' 123abc' ---
+string(20) "2d393339353234303936"
+--- testing: '-7.7' << '123 abc' ---
+string(20) "2d393339353234303936"
+--- testing: '-7.7' << '123abc ' ---
+string(20) "2d393339353234303936"
+--- testing: '-7.7' << '3.4a' ---
+string(6) "2d3536"
+--- testing: '-7.7' << 'a5.9' ---
+string(4) "2d37"
+--- testing: 'abc' << '0' ---
+string(2) "30"
+--- testing: 'abc' << '65' ---
+string(2) "30"
+--- testing: 'abc' << '-44' ---
+string(2) "30"
+--- testing: 'abc' << '1.2' ---
+string(2) "30"
+--- testing: 'abc' << '-7.7' ---
+string(2) "30"
+--- testing: 'abc' << 'abc' ---
+string(2) "30"
+--- testing: 'abc' << '123abc' ---
+string(2) "30"
+--- testing: 'abc' << '123e5' ---
+string(2) "30"
+--- testing: 'abc' << '123e5xyz' ---
+string(2) "30"
+--- testing: 'abc' << ' 123abc' ---
+string(2) "30"
+--- testing: 'abc' << '123 abc' ---
+string(2) "30"
+--- testing: 'abc' << '123abc ' ---
+string(2) "30"
+--- testing: 'abc' << '3.4a' ---
+string(2) "30"
+--- testing: 'abc' << 'a5.9' ---
+string(2) "30"
+--- testing: '123abc' << '0' ---
+string(6) "313233"
+--- testing: '123abc' << '65' ---
+string(6) "323436"
+--- testing: '123abc' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123abc' << '1.2' ---
+string(6) "323436"
+--- testing: '123abc' << '-7.7' ---
+string(20) "2d313637373732313630"
+--- testing: '123abc' << 'abc' ---
+string(6) "313233"
+--- testing: '123abc' << '123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc' << '123e5' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc' << '123e5xyz' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc' << ' 123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc' << '123 abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc' << '123abc ' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc' << '3.4a' ---
+string(6) "393834"
+--- testing: '123abc' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123e5' << '0' ---
+string(6) "313233"
+--- testing: '123e5' << '65' ---
+string(6) "323436"
+--- testing: '123e5' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123e5' << '1.2' ---
+string(6) "323436"
+--- testing: '123e5' << '-7.7' ---
+string(20) "2d313637373732313630"
+--- testing: '123e5' << 'abc' ---
+string(6) "313233"
+--- testing: '123e5' << '123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5' << '123e5' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5' << '123e5xyz' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5' << ' 123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5' << '123 abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5' << '123abc ' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5' << '3.4a' ---
+string(6) "393834"
+--- testing: '123e5' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123e5xyz' << '0' ---
+string(6) "313233"
+--- testing: '123e5xyz' << '65' ---
+string(6) "323436"
+--- testing: '123e5xyz' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123e5xyz' << '1.2' ---
+string(6) "323436"
+--- testing: '123e5xyz' << '-7.7' ---
+string(20) "2d313637373732313630"
+--- testing: '123e5xyz' << 'abc' ---
+string(6) "313233"
+--- testing: '123e5xyz' << '123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5xyz' << '123e5' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5xyz' << '123e5xyz' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5xyz' << ' 123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5xyz' << '123 abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5xyz' << '123abc ' ---
+string(20) "2d363731303838363430"
+--- testing: '123e5xyz' << '3.4a' ---
+string(6) "393834"
+--- testing: '123e5xyz' << 'a5.9' ---
+string(6) "313233"
+--- testing: ' 123abc' << '0' ---
+string(6) "313233"
+--- testing: ' 123abc' << '65' ---
+string(6) "323436"
+--- testing: ' 123abc' << '-44' ---
+string(18) "313238393734383438"
+--- testing: ' 123abc' << '1.2' ---
+string(6) "323436"
+--- testing: ' 123abc' << '-7.7' ---
+string(20) "2d313637373732313630"
+--- testing: ' 123abc' << 'abc' ---
+string(6) "313233"
+--- testing: ' 123abc' << '123abc' ---
+string(20) "2d363731303838363430"
+--- testing: ' 123abc' << '123e5' ---
+string(20) "2d363731303838363430"
+--- testing: ' 123abc' << '123e5xyz' ---
+string(20) "2d363731303838363430"
+--- testing: ' 123abc' << ' 123abc' ---
+string(20) "2d363731303838363430"
+--- testing: ' 123abc' << '123 abc' ---
+string(20) "2d363731303838363430"
+--- testing: ' 123abc' << '123abc ' ---
+string(20) "2d363731303838363430"
+--- testing: ' 123abc' << '3.4a' ---
+string(6) "393834"
+--- testing: ' 123abc' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123 abc' << '0' ---
+string(6) "313233"
+--- testing: '123 abc' << '65' ---
+string(6) "323436"
+--- testing: '123 abc' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123 abc' << '1.2' ---
+string(6) "323436"
+--- testing: '123 abc' << '-7.7' ---
+string(20) "2d313637373732313630"
+--- testing: '123 abc' << 'abc' ---
+string(6) "313233"
+--- testing: '123 abc' << '123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123 abc' << '123e5' ---
+string(20) "2d363731303838363430"
+--- testing: '123 abc' << '123e5xyz' ---
+string(20) "2d363731303838363430"
+--- testing: '123 abc' << ' 123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123 abc' << '123 abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123 abc' << '123abc ' ---
+string(20) "2d363731303838363430"
+--- testing: '123 abc' << '3.4a' ---
+string(6) "393834"
+--- testing: '123 abc' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123abc ' << '0' ---
+string(6) "313233"
+--- testing: '123abc ' << '65' ---
+string(6) "323436"
+--- testing: '123abc ' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123abc ' << '1.2' ---
+string(6) "323436"
+--- testing: '123abc ' << '-7.7' ---
+string(20) "2d313637373732313630"
+--- testing: '123abc ' << 'abc' ---
+string(6) "313233"
+--- testing: '123abc ' << '123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc ' << '123e5' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc ' << '123e5xyz' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc ' << ' 123abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc ' << '123 abc' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc ' << '123abc ' ---
+string(20) "2d363731303838363430"
+--- testing: '123abc ' << '3.4a' ---
+string(6) "393834"
+--- testing: '123abc ' << 'a5.9' ---
+string(6) "313233"
+--- testing: '3.4a' << '0' ---
+string(2) "33"
+--- testing: '3.4a' << '65' ---
+string(2) "36"
+--- testing: '3.4a' << '-44' ---
+string(14) "33313435373238"
+--- testing: '3.4a' << '1.2' ---
+string(2) "36"
+--- testing: '3.4a' << '-7.7' ---
+string(18) "313030363633323936"
+--- testing: '3.4a' << 'abc' ---
+string(2) "33"
+--- testing: '3.4a' << '123abc' ---
+string(18) "343032363533313834"
+--- testing: '3.4a' << '123e5' ---
+string(18) "343032363533313834"
+--- testing: '3.4a' << '123e5xyz' ---
+string(18) "343032363533313834"
+--- testing: '3.4a' << ' 123abc' ---
+string(18) "343032363533313834"
+--- testing: '3.4a' << '123 abc' ---
+string(18) "343032363533313834"
+--- testing: '3.4a' << '123abc ' ---
+string(18) "343032363533313834"
+--- testing: '3.4a' << '3.4a' ---
+string(4) "3234"
+--- testing: '3.4a' << 'a5.9' ---
+string(2) "33"
+--- testing: 'a5.9' << '0' ---
+string(2) "30"
+--- testing: 'a5.9' << '65' ---
+string(2) "30"
+--- testing: 'a5.9' << '-44' ---
+string(2) "30"
+--- testing: 'a5.9' << '1.2' ---
+string(2) "30"
+--- testing: 'a5.9' << '-7.7' ---
+string(2) "30"
+--- testing: 'a5.9' << 'abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123e5' ---
+string(2) "30"
+--- testing: 'a5.9' << '123e5xyz' ---
+string(2) "30"
+--- testing: 'a5.9' << ' 123abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123 abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123abc ' ---
+string(2) "30"
+--- testing: 'a5.9' << '3.4a' ---
+string(2) "30"
+--- testing: 'a5.9' << 'a5.9' ---
+string(2) "30"
+===DONE===
+
diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
new file mode 100644
index 0000000..0b697c8
--- /dev/null
+++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt
@@ -0,0 +1,420 @@
+--TEST--
+Test << operator : various numbers as strings
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' << '$otherVal' ---\n";
+ var_dump(bin2hex($strVal<<$otherVal));
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' << '0' ---
+string(2) "30"
+--- testing: '0' << '65' ---
+string(2) "30"
+--- testing: '0' << '-44' ---
+string(2) "30"
+--- testing: '0' << '1.2' ---
+string(2) "30"
+--- testing: '0' << '-7.7' ---
+string(2) "30"
+--- testing: '0' << 'abc' ---
+string(2) "30"
+--- testing: '0' << '123abc' ---
+string(2) "30"
+--- testing: '0' << '123e5' ---
+string(2) "30"
+--- testing: '0' << '123e5xyz' ---
+string(2) "30"
+--- testing: '0' << ' 123abc' ---
+string(2) "30"
+--- testing: '0' << '123 abc' ---
+string(2) "30"
+--- testing: '0' << '123abc ' ---
+string(2) "30"
+--- testing: '0' << '3.4a' ---
+string(2) "30"
+--- testing: '0' << 'a5.9' ---
+string(2) "30"
+--- testing: '65' << '0' ---
+string(4) "3635"
+--- testing: '65' << '65' ---
+string(6) "313330"
+--- testing: '65' << '-44' ---
+string(16) "3638313537343430"
+--- testing: '65' << '1.2' ---
+string(6) "313330"
+--- testing: '65' << '-7.7' ---
+string(40) "2d39303739323536383438373738393139393336"
+--- testing: '65' << 'abc' ---
+string(4) "3635"
+--- testing: '65' << '123abc' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '65' << '123e5' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '65' << '123e5xyz' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '65' << ' 123abc' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '65' << '123 abc' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '65' << '123abc ' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '65' << '3.4a' ---
+string(6) "353230"
+--- testing: '65' << 'a5.9' ---
+string(4) "3635"
+--- testing: '-44' << '0' ---
+string(6) "2d3434"
+--- testing: '-44' << '65' ---
+string(6) "2d3838"
+--- testing: '-44' << '-44' ---
+string(18) "2d3436313337333434"
+--- testing: '-44' << '1.2' ---
+string(6) "2d3838"
+--- testing: '-44' << '-7.7' ---
+string(40) "2d36333431303638323735333337363538333638"
+--- testing: '-44' << 'abc' ---
+string(6) "2d3434"
+--- testing: '-44' << '123abc' ---
+string(40) "2d36393137353239303237363431303831383536"
+--- testing: '-44' << '123e5' ---
+string(40) "2d36393137353239303237363431303831383536"
+--- testing: '-44' << '123e5xyz' ---
+string(40) "2d36393137353239303237363431303831383536"
+--- testing: '-44' << ' 123abc' ---
+string(40) "2d36393137353239303237363431303831383536"
+--- testing: '-44' << '123 abc' ---
+string(40) "2d36393137353239303237363431303831383536"
+--- testing: '-44' << '123abc ' ---
+string(40) "2d36393137353239303237363431303831383536"
+--- testing: '-44' << '3.4a' ---
+string(8) "2d333532"
+--- testing: '-44' << 'a5.9' ---
+string(6) "2d3434"
+--- testing: '1.2' << '0' ---
+string(2) "31"
+--- testing: '1.2' << '65' ---
+string(2) "32"
+--- testing: '1.2' << '-44' ---
+string(14) "31303438353736"
+--- testing: '1.2' << '1.2' ---
+string(2) "32"
+--- testing: '1.2' << '-7.7' ---
+string(36) "313434313135313838303735383535383732"
+--- testing: '1.2' << 'abc' ---
+string(2) "31"
+--- testing: '1.2' << '123abc' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '1.2' << '123e5' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '1.2' << '123e5xyz' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '1.2' << ' 123abc' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '1.2' << '123 abc' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '1.2' << '123abc ' ---
+string(36) "353736343630373532333033343233343838"
+--- testing: '1.2' << '3.4a' ---
+string(2) "38"
+--- testing: '1.2' << 'a5.9' ---
+string(2) "31"
+--- testing: '-7.7' << '0' ---
+string(4) "2d37"
+--- testing: '-7.7' << '65' ---
+string(6) "2d3134"
+--- testing: '-7.7' << '-44' ---
+string(16) "2d37333430303332"
+--- testing: '-7.7' << '1.2' ---
+string(6) "2d3134"
+--- testing: '-7.7' << '-7.7' ---
+string(40) "2d31303038383036333136353330393931313034"
+--- testing: '-7.7' << 'abc' ---
+string(4) "2d37"
+--- testing: '-7.7' << '123abc' ---
+string(40) "2d34303335323235323636313233393634343136"
+--- testing: '-7.7' << '123e5' ---
+string(40) "2d34303335323235323636313233393634343136"
+--- testing: '-7.7' << '123e5xyz' ---
+string(40) "2d34303335323235323636313233393634343136"
+--- testing: '-7.7' << ' 123abc' ---
+string(40) "2d34303335323235323636313233393634343136"
+--- testing: '-7.7' << '123 abc' ---
+string(40) "2d34303335323235323636313233393634343136"
+--- testing: '-7.7' << '123abc ' ---
+string(40) "2d34303335323235323636313233393634343136"
+--- testing: '-7.7' << '3.4a' ---
+string(6) "2d3536"
+--- testing: '-7.7' << 'a5.9' ---
+string(4) "2d37"
+--- testing: 'abc' << '0' ---
+string(2) "30"
+--- testing: 'abc' << '65' ---
+string(2) "30"
+--- testing: 'abc' << '-44' ---
+string(2) "30"
+--- testing: 'abc' << '1.2' ---
+string(2) "30"
+--- testing: 'abc' << '-7.7' ---
+string(2) "30"
+--- testing: 'abc' << 'abc' ---
+string(2) "30"
+--- testing: 'abc' << '123abc' ---
+string(2) "30"
+--- testing: 'abc' << '123e5' ---
+string(2) "30"
+--- testing: 'abc' << '123e5xyz' ---
+string(2) "30"
+--- testing: 'abc' << ' 123abc' ---
+string(2) "30"
+--- testing: 'abc' << '123 abc' ---
+string(2) "30"
+--- testing: 'abc' << '123abc ' ---
+string(2) "30"
+--- testing: 'abc' << '3.4a' ---
+string(2) "30"
+--- testing: 'abc' << 'a5.9' ---
+string(2) "30"
+--- testing: '123abc' << '0' ---
+string(6) "313233"
+--- testing: '123abc' << '65' ---
+string(6) "323436"
+--- testing: '123abc' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123abc' << '1.2' ---
+string(6) "323436"
+--- testing: '123abc' << '-7.7' ---
+string(38) "2d373230353735393430333739323739333630"
+--- testing: '123abc' << 'abc' ---
+string(6) "313233"
+--- testing: '123abc' << '123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc' << '123e5' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc' << '123e5xyz' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc' << ' 123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc' << '123 abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc' << '123abc ' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc' << '3.4a' ---
+string(6) "393834"
+--- testing: '123abc' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123e5' << '0' ---
+string(6) "313233"
+--- testing: '123e5' << '65' ---
+string(6) "323436"
+--- testing: '123e5' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123e5' << '1.2' ---
+string(6) "323436"
+--- testing: '123e5' << '-7.7' ---
+string(38) "2d373230353735393430333739323739333630"
+--- testing: '123e5' << 'abc' ---
+string(6) "313233"
+--- testing: '123e5' << '123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5' << '123e5' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5' << '123e5xyz' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5' << ' 123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5' << '123 abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5' << '123abc ' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5' << '3.4a' ---
+string(6) "393834"
+--- testing: '123e5' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123e5xyz' << '0' ---
+string(6) "313233"
+--- testing: '123e5xyz' << '65' ---
+string(6) "323436"
+--- testing: '123e5xyz' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123e5xyz' << '1.2' ---
+string(6) "323436"
+--- testing: '123e5xyz' << '-7.7' ---
+string(38) "2d373230353735393430333739323739333630"
+--- testing: '123e5xyz' << 'abc' ---
+string(6) "313233"
+--- testing: '123e5xyz' << '123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5xyz' << '123e5' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5xyz' << '123e5xyz' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5xyz' << ' 123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5xyz' << '123 abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5xyz' << '123abc ' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123e5xyz' << '3.4a' ---
+string(6) "393834"
+--- testing: '123e5xyz' << 'a5.9' ---
+string(6) "313233"
+--- testing: ' 123abc' << '0' ---
+string(6) "313233"
+--- testing: ' 123abc' << '65' ---
+string(6) "323436"
+--- testing: ' 123abc' << '-44' ---
+string(18) "313238393734383438"
+--- testing: ' 123abc' << '1.2' ---
+string(6) "323436"
+--- testing: ' 123abc' << '-7.7' ---
+string(38) "2d373230353735393430333739323739333630"
+--- testing: ' 123abc' << 'abc' ---
+string(6) "313233"
+--- testing: ' 123abc' << '123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: ' 123abc' << '123e5' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: ' 123abc' << '123e5xyz' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: ' 123abc' << ' 123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: ' 123abc' << '123 abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: ' 123abc' << '123abc ' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: ' 123abc' << '3.4a' ---
+string(6) "393834"
+--- testing: ' 123abc' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123 abc' << '0' ---
+string(6) "313233"
+--- testing: '123 abc' << '65' ---
+string(6) "323436"
+--- testing: '123 abc' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123 abc' << '1.2' ---
+string(6) "323436"
+--- testing: '123 abc' << '-7.7' ---
+string(38) "2d373230353735393430333739323739333630"
+--- testing: '123 abc' << 'abc' ---
+string(6) "313233"
+--- testing: '123 abc' << '123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123 abc' << '123e5' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123 abc' << '123e5xyz' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123 abc' << ' 123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123 abc' << '123 abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123 abc' << '123abc ' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123 abc' << '3.4a' ---
+string(6) "393834"
+--- testing: '123 abc' << 'a5.9' ---
+string(6) "313233"
+--- testing: '123abc ' << '0' ---
+string(6) "313233"
+--- testing: '123abc ' << '65' ---
+string(6) "323436"
+--- testing: '123abc ' << '-44' ---
+string(18) "313238393734383438"
+--- testing: '123abc ' << '1.2' ---
+string(6) "323436"
+--- testing: '123abc ' << '-7.7' ---
+string(38) "2d373230353735393430333739323739333630"
+--- testing: '123abc ' << 'abc' ---
+string(6) "313233"
+--- testing: '123abc ' << '123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc ' << '123e5' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc ' << '123e5xyz' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc ' << ' 123abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc ' << '123 abc' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc ' << '123abc ' ---
+string(40) "2d32383832333033373631353137313137343430"
+--- testing: '123abc ' << '3.4a' ---
+string(6) "393834"
+--- testing: '123abc ' << 'a5.9' ---
+string(6) "313233"
+--- testing: '3.4a' << '0' ---
+string(2) "33"
+--- testing: '3.4a' << '65' ---
+string(2) "36"
+--- testing: '3.4a' << '-44' ---
+string(14) "33313435373238"
+--- testing: '3.4a' << '1.2' ---
+string(2) "36"
+--- testing: '3.4a' << '-7.7' ---
+string(36) "343332333435353634323237353637363136"
+--- testing: '3.4a' << 'abc' ---
+string(2) "33"
+--- testing: '3.4a' << '123abc' ---
+string(38) "31373239333832323536393130323730343634"
+--- testing: '3.4a' << '123e5' ---
+string(38) "31373239333832323536393130323730343634"
+--- testing: '3.4a' << '123e5xyz' ---
+string(38) "31373239333832323536393130323730343634"
+--- testing: '3.4a' << ' 123abc' ---
+string(38) "31373239333832323536393130323730343634"
+--- testing: '3.4a' << '123 abc' ---
+string(38) "31373239333832323536393130323730343634"
+--- testing: '3.4a' << '123abc ' ---
+string(38) "31373239333832323536393130323730343634"
+--- testing: '3.4a' << '3.4a' ---
+string(4) "3234"
+--- testing: '3.4a' << 'a5.9' ---
+string(2) "33"
+--- testing: 'a5.9' << '0' ---
+string(2) "30"
+--- testing: 'a5.9' << '65' ---
+string(2) "30"
+--- testing: 'a5.9' << '-44' ---
+string(2) "30"
+--- testing: 'a5.9' << '1.2' ---
+string(2) "30"
+--- testing: 'a5.9' << '-7.7' ---
+string(2) "30"
+--- testing: 'a5.9' << 'abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123e5' ---
+string(2) "30"
+--- testing: 'a5.9' << '123e5xyz' ---
+string(2) "30"
+--- testing: 'a5.9' << ' 123abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123 abc' ---
+string(2) "30"
+--- testing: 'a5.9' << '123abc ' ---
+string(2) "30"
+--- testing: 'a5.9' << '3.4a' ---
+string(2) "30"
+--- testing: 'a5.9' << 'a5.9' ---
+string(2) "30"
+===DONE===
diff --git a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt
new file mode 100644
index 0000000..1029d19
--- /dev/null
+++ b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt
@@ -0,0 +1,583 @@
+--TEST--
+Test >> operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal >> $otherVal ---\n";
+ var_dump($longVal>>$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal >> $longVal ---\n";
+ var_dump($otherVal>>$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 >> 0 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 >> 1 ---
+int(4611686018427387903)
+--- testing: 9223372036854775807 >> -1 ---
+int(0)
+--- testing: 9223372036854775807 >> 7 ---
+int(72057594037927935)
+--- testing: 9223372036854775807 >> 9 ---
+int(18014398509481983)
+--- testing: 9223372036854775807 >> 65 ---
+int(4611686018427387903)
+--- testing: 9223372036854775807 >> -44 ---
+int(8796093022207)
+--- testing: 9223372036854775807 >> 2147483647 ---
+int(0)
+--- testing: 9223372036854775807 >> 9223372036854775807 ---
+int(0)
+--- testing: -9223372036854775808 >> 0 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 >> 1 ---
+int(-4611686018427387904)
+--- testing: -9223372036854775808 >> -1 ---
+int(-1)
+--- testing: -9223372036854775808 >> 7 ---
+int(-72057594037927936)
+--- testing: -9223372036854775808 >> 9 ---
+int(-18014398509481984)
+--- testing: -9223372036854775808 >> 65 ---
+int(-4611686018427387904)
+--- testing: -9223372036854775808 >> -44 ---
+int(-8796093022208)
+--- testing: -9223372036854775808 >> 2147483647 ---
+int(-1)
+--- testing: -9223372036854775808 >> 9223372036854775807 ---
+int(-1)
+--- testing: 2147483647 >> 0 ---
+int(2147483647)
+--- testing: 2147483647 >> 1 ---
+int(1073741823)
+--- testing: 2147483647 >> -1 ---
+int(0)
+--- testing: 2147483647 >> 7 ---
+int(16777215)
+--- testing: 2147483647 >> 9 ---
+int(4194303)
+--- testing: 2147483647 >> 65 ---
+int(1073741823)
+--- testing: 2147483647 >> -44 ---
+int(2047)
+--- testing: 2147483647 >> 2147483647 ---
+int(0)
+--- testing: 2147483647 >> 9223372036854775807 ---
+int(0)
+--- testing: -2147483648 >> 0 ---
+int(-2147483648)
+--- testing: -2147483648 >> 1 ---
+int(-1073741824)
+--- testing: -2147483648 >> -1 ---
+int(-1)
+--- testing: -2147483648 >> 7 ---
+int(-16777216)
+--- testing: -2147483648 >> 9 ---
+int(-4194304)
+--- testing: -2147483648 >> 65 ---
+int(-1073741824)
+--- testing: -2147483648 >> -44 ---
+int(-2048)
+--- testing: -2147483648 >> 2147483647 ---
+int(-1)
+--- testing: -2147483648 >> 9223372036854775807 ---
+int(-1)
+--- testing: 9223372034707292160 >> 0 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 >> 1 ---
+int(4611686017353646080)
+--- testing: 9223372034707292160 >> -1 ---
+int(0)
+--- testing: 9223372034707292160 >> 7 ---
+int(72057594021150720)
+--- testing: 9223372034707292160 >> 9 ---
+int(18014398505287680)
+--- testing: 9223372034707292160 >> 65 ---
+int(4611686017353646080)
+--- testing: 9223372034707292160 >> -44 ---
+int(8796093020160)
+--- testing: 9223372034707292160 >> 2147483647 ---
+int(0)
+--- testing: 9223372034707292160 >> 9223372036854775807 ---
+int(0)
+--- testing: -9223372034707292160 >> 0 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 >> 1 ---
+int(-4611686017353646080)
+--- testing: -9223372034707292160 >> -1 ---
+int(-1)
+--- testing: -9223372034707292160 >> 7 ---
+int(-72057594021150720)
+--- testing: -9223372034707292160 >> 9 ---
+int(-18014398505287680)
+--- testing: -9223372034707292160 >> 65 ---
+int(-4611686017353646080)
+--- testing: -9223372034707292160 >> -44 ---
+int(-8796093020160)
+--- testing: -9223372034707292160 >> 2147483647 ---
+int(-1)
+--- testing: -9223372034707292160 >> 9223372036854775807 ---
+int(-1)
+--- testing: 2147483648 >> 0 ---
+int(2147483648)
+--- testing: 2147483648 >> 1 ---
+int(1073741824)
+--- testing: 2147483648 >> -1 ---
+int(0)
+--- testing: 2147483648 >> 7 ---
+int(16777216)
+--- testing: 2147483648 >> 9 ---
+int(4194304)
+--- testing: 2147483648 >> 65 ---
+int(1073741824)
+--- testing: 2147483648 >> -44 ---
+int(2048)
+--- testing: 2147483648 >> 2147483647 ---
+int(0)
+--- testing: 2147483648 >> 9223372036854775807 ---
+int(0)
+--- testing: -2147483649 >> 0 ---
+int(-2147483649)
+--- testing: -2147483649 >> 1 ---
+int(-1073741825)
+--- testing: -2147483649 >> -1 ---
+int(-1)
+--- testing: -2147483649 >> 7 ---
+int(-16777217)
+--- testing: -2147483649 >> 9 ---
+int(-4194305)
+--- testing: -2147483649 >> 65 ---
+int(-1073741825)
+--- testing: -2147483649 >> -44 ---
+int(-2049)
+--- testing: -2147483649 >> 2147483647 ---
+int(-1)
+--- testing: -2147483649 >> 9223372036854775807 ---
+int(-1)
+--- testing: 4294967294 >> 0 ---
+int(4294967294)
+--- testing: 4294967294 >> 1 ---
+int(2147483647)
+--- testing: 4294967294 >> -1 ---
+int(0)
+--- testing: 4294967294 >> 7 ---
+int(33554431)
+--- testing: 4294967294 >> 9 ---
+int(8388607)
+--- testing: 4294967294 >> 65 ---
+int(2147483647)
+--- testing: 4294967294 >> -44 ---
+int(4095)
+--- testing: 4294967294 >> 2147483647 ---
+int(0)
+--- testing: 4294967294 >> 9223372036854775807 ---
+int(0)
+--- testing: 4294967295 >> 0 ---
+int(4294967295)
+--- testing: 4294967295 >> 1 ---
+int(2147483647)
+--- testing: 4294967295 >> -1 ---
+int(0)
+--- testing: 4294967295 >> 7 ---
+int(33554431)
+--- testing: 4294967295 >> 9 ---
+int(8388607)
+--- testing: 4294967295 >> 65 ---
+int(2147483647)
+--- testing: 4294967295 >> -44 ---
+int(4095)
+--- testing: 4294967295 >> 2147483647 ---
+int(0)
+--- testing: 4294967295 >> 9223372036854775807 ---
+int(0)
+--- testing: 4294967293 >> 0 ---
+int(4294967293)
+--- testing: 4294967293 >> 1 ---
+int(2147483646)
+--- testing: 4294967293 >> -1 ---
+int(0)
+--- testing: 4294967293 >> 7 ---
+int(33554431)
+--- testing: 4294967293 >> 9 ---
+int(8388607)
+--- testing: 4294967293 >> 65 ---
+int(2147483646)
+--- testing: 4294967293 >> -44 ---
+int(4095)
+--- testing: 4294967293 >> 2147483647 ---
+int(0)
+--- testing: 4294967293 >> 9223372036854775807 ---
+int(0)
+--- testing: 9223372036854775806 >> 0 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 >> 1 ---
+int(4611686018427387903)
+--- testing: 9223372036854775806 >> -1 ---
+int(0)
+--- testing: 9223372036854775806 >> 7 ---
+int(72057594037927935)
+--- testing: 9223372036854775806 >> 9 ---
+int(18014398509481983)
+--- testing: 9223372036854775806 >> 65 ---
+int(4611686018427387903)
+--- testing: 9223372036854775806 >> -44 ---
+int(8796093022207)
+--- testing: 9223372036854775806 >> 2147483647 ---
+int(0)
+--- testing: 9223372036854775806 >> 9223372036854775807 ---
+int(0)
+--- testing: 9.2233720368548E+18 >> 0 ---
+int(-9223372036854775808)
+--- testing: 9.2233720368548E+18 >> 1 ---
+int(-4611686018427387904)
+--- testing: 9.2233720368548E+18 >> -1 ---
+int(-1)
+--- testing: 9.2233720368548E+18 >> 7 ---
+int(-72057594037927936)
+--- testing: 9.2233720368548E+18 >> 9 ---
+int(-18014398509481984)
+--- testing: 9.2233720368548E+18 >> 65 ---
+int(-4611686018427387904)
+--- testing: 9.2233720368548E+18 >> -44 ---
+int(-8796093022208)
+--- testing: 9.2233720368548E+18 >> 2147483647 ---
+int(-1)
+--- testing: 9.2233720368548E+18 >> 9223372036854775807 ---
+int(-1)
+--- testing: -9223372036854775807 >> 0 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 >> 1 ---
+int(-4611686018427387904)
+--- testing: -9223372036854775807 >> -1 ---
+int(-1)
+--- testing: -9223372036854775807 >> 7 ---
+int(-72057594037927936)
+--- testing: -9223372036854775807 >> 9 ---
+int(-18014398509481984)
+--- testing: -9223372036854775807 >> 65 ---
+int(-4611686018427387904)
+--- testing: -9223372036854775807 >> -44 ---
+int(-8796093022208)
+--- testing: -9223372036854775807 >> 2147483647 ---
+int(-1)
+--- testing: -9223372036854775807 >> 9223372036854775807 ---
+int(-1)
+--- testing: -9.2233720368548E+18 >> 0 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 >> 1 ---
+int(-4611686018427387904)
+--- testing: -9.2233720368548E+18 >> -1 ---
+int(-1)
+--- testing: -9.2233720368548E+18 >> 7 ---
+int(-72057594037927936)
+--- testing: -9.2233720368548E+18 >> 9 ---
+int(-18014398509481984)
+--- testing: -9.2233720368548E+18 >> 65 ---
+int(-4611686018427387904)
+--- testing: -9.2233720368548E+18 >> -44 ---
+int(-8796093022208)
+--- testing: -9.2233720368548E+18 >> 2147483647 ---
+int(-1)
+--- testing: -9.2233720368548E+18 >> 9223372036854775807 ---
+int(-1)
+--- testing: 0 >> 9223372036854775807 ---
+int(0)
+--- testing: 0 >> -9223372036854775808 ---
+int(0)
+--- testing: 0 >> 2147483647 ---
+int(0)
+--- testing: 0 >> -2147483648 ---
+int(0)
+--- testing: 0 >> 9223372034707292160 ---
+int(0)
+--- testing: 0 >> -9223372034707292160 ---
+int(0)
+--- testing: 0 >> 2147483648 ---
+int(0)
+--- testing: 0 >> -2147483649 ---
+int(0)
+--- testing: 0 >> 4294967294 ---
+int(0)
+--- testing: 0 >> 4294967295 ---
+int(0)
+--- testing: 0 >> 4294967293 ---
+int(0)
+--- testing: 0 >> 9223372036854775806 ---
+int(0)
+--- testing: 0 >> 9.2233720368548E+18 ---
+int(0)
+--- testing: 0 >> -9223372036854775807 ---
+int(0)
+--- testing: 0 >> -9.2233720368548E+18 ---
+int(0)
+--- testing: 1 >> 9223372036854775807 ---
+int(0)
+--- testing: 1 >> -9223372036854775808 ---
+int(1)
+--- testing: 1 >> 2147483647 ---
+int(0)
+--- testing: 1 >> -2147483648 ---
+int(1)
+--- testing: 1 >> 9223372034707292160 ---
+int(1)
+--- testing: 1 >> -9223372034707292160 ---
+int(1)
+--- testing: 1 >> 2147483648 ---
+int(1)
+--- testing: 1 >> -2147483649 ---
+int(0)
+--- testing: 1 >> 4294967294 ---
+int(0)
+--- testing: 1 >> 4294967295 ---
+int(0)
+--- testing: 1 >> 4294967293 ---
+int(0)
+--- testing: 1 >> 9223372036854775806 ---
+int(0)
+--- testing: 1 >> 9.2233720368548E+18 ---
+int(1)
+--- testing: 1 >> -9223372036854775807 ---
+int(0)
+--- testing: 1 >> -9.2233720368548E+18 ---
+int(1)
+--- testing: -1 >> 9223372036854775807 ---
+int(-1)
+--- testing: -1 >> -9223372036854775808 ---
+int(-1)
+--- testing: -1 >> 2147483647 ---
+int(-1)
+--- testing: -1 >> -2147483648 ---
+int(-1)
+--- testing: -1 >> 9223372034707292160 ---
+int(-1)
+--- testing: -1 >> -9223372034707292160 ---
+int(-1)
+--- testing: -1 >> 2147483648 ---
+int(-1)
+--- testing: -1 >> -2147483649 ---
+int(-1)
+--- testing: -1 >> 4294967294 ---
+int(-1)
+--- testing: -1 >> 4294967295 ---
+int(-1)
+--- testing: -1 >> 4294967293 ---
+int(-1)
+--- testing: -1 >> 9223372036854775806 ---
+int(-1)
+--- testing: -1 >> 9.2233720368548E+18 ---
+int(-1)
+--- testing: -1 >> -9223372036854775807 ---
+int(-1)
+--- testing: -1 >> -9.2233720368548E+18 ---
+int(-1)
+--- testing: 7 >> 9223372036854775807 ---
+int(0)
+--- testing: 7 >> -9223372036854775808 ---
+int(7)
+--- testing: 7 >> 2147483647 ---
+int(0)
+--- testing: 7 >> -2147483648 ---
+int(7)
+--- testing: 7 >> 9223372034707292160 ---
+int(7)
+--- testing: 7 >> -9223372034707292160 ---
+int(7)
+--- testing: 7 >> 2147483648 ---
+int(7)
+--- testing: 7 >> -2147483649 ---
+int(0)
+--- testing: 7 >> 4294967294 ---
+int(0)
+--- testing: 7 >> 4294967295 ---
+int(0)
+--- testing: 7 >> 4294967293 ---
+int(0)
+--- testing: 7 >> 9223372036854775806 ---
+int(0)
+--- testing: 7 >> 9.2233720368548E+18 ---
+int(7)
+--- testing: 7 >> -9223372036854775807 ---
+int(3)
+--- testing: 7 >> -9.2233720368548E+18 ---
+int(7)
+--- testing: 9 >> 9223372036854775807 ---
+int(0)
+--- testing: 9 >> -9223372036854775808 ---
+int(9)
+--- testing: 9 >> 2147483647 ---
+int(0)
+--- testing: 9 >> -2147483648 ---
+int(9)
+--- testing: 9 >> 9223372034707292160 ---
+int(9)
+--- testing: 9 >> -9223372034707292160 ---
+int(9)
+--- testing: 9 >> 2147483648 ---
+int(9)
+--- testing: 9 >> -2147483649 ---
+int(0)
+--- testing: 9 >> 4294967294 ---
+int(0)
+--- testing: 9 >> 4294967295 ---
+int(0)
+--- testing: 9 >> 4294967293 ---
+int(0)
+--- testing: 9 >> 9223372036854775806 ---
+int(0)
+--- testing: 9 >> 9.2233720368548E+18 ---
+int(9)
+--- testing: 9 >> -9223372036854775807 ---
+int(4)
+--- testing: 9 >> -9.2233720368548E+18 ---
+int(9)
+--- testing: 65 >> 9223372036854775807 ---
+int(0)
+--- testing: 65 >> -9223372036854775808 ---
+int(65)
+--- testing: 65 >> 2147483647 ---
+int(0)
+--- testing: 65 >> -2147483648 ---
+int(65)
+--- testing: 65 >> 9223372034707292160 ---
+int(65)
+--- testing: 65 >> -9223372034707292160 ---
+int(65)
+--- testing: 65 >> 2147483648 ---
+int(65)
+--- testing: 65 >> -2147483649 ---
+int(0)
+--- testing: 65 >> 4294967294 ---
+int(0)
+--- testing: 65 >> 4294967295 ---
+int(0)
+--- testing: 65 >> 4294967293 ---
+int(0)
+--- testing: 65 >> 9223372036854775806 ---
+int(0)
+--- testing: 65 >> 9.2233720368548E+18 ---
+int(65)
+--- testing: 65 >> -9223372036854775807 ---
+int(32)
+--- testing: 65 >> -9.2233720368548E+18 ---
+int(65)
+--- testing: -44 >> 9223372036854775807 ---
+int(-1)
+--- testing: -44 >> -9223372036854775808 ---
+int(-44)
+--- testing: -44 >> 2147483647 ---
+int(-1)
+--- testing: -44 >> -2147483648 ---
+int(-44)
+--- testing: -44 >> 9223372034707292160 ---
+int(-44)
+--- testing: -44 >> -9223372034707292160 ---
+int(-44)
+--- testing: -44 >> 2147483648 ---
+int(-44)
+--- testing: -44 >> -2147483649 ---
+int(-1)
+--- testing: -44 >> 4294967294 ---
+int(-1)
+--- testing: -44 >> 4294967295 ---
+int(-1)
+--- testing: -44 >> 4294967293 ---
+int(-1)
+--- testing: -44 >> 9223372036854775806 ---
+int(-1)
+--- testing: -44 >> 9.2233720368548E+18 ---
+int(-44)
+--- testing: -44 >> -9223372036854775807 ---
+int(-22)
+--- testing: -44 >> -9.2233720368548E+18 ---
+int(-44)
+--- testing: 2147483647 >> 9223372036854775807 ---
+int(0)
+--- testing: 2147483647 >> -9223372036854775808 ---
+int(2147483647)
+--- testing: 2147483647 >> 2147483647 ---
+int(0)
+--- testing: 2147483647 >> -2147483648 ---
+int(2147483647)
+--- testing: 2147483647 >> 9223372034707292160 ---
+int(2147483647)
+--- testing: 2147483647 >> -9223372034707292160 ---
+int(2147483647)
+--- testing: 2147483647 >> 2147483648 ---
+int(2147483647)
+--- testing: 2147483647 >> -2147483649 ---
+int(0)
+--- testing: 2147483647 >> 4294967294 ---
+int(0)
+--- testing: 2147483647 >> 4294967295 ---
+int(0)
+--- testing: 2147483647 >> 4294967293 ---
+int(0)
+--- testing: 2147483647 >> 9223372036854775806 ---
+int(0)
+--- testing: 2147483647 >> 9.2233720368548E+18 ---
+int(2147483647)
+--- testing: 2147483647 >> -9223372036854775807 ---
+int(1073741823)
+--- testing: 2147483647 >> -9.2233720368548E+18 ---
+int(2147483647)
+--- testing: 9223372036854775807 >> 9223372036854775807 ---
+int(0)
+--- testing: 9223372036854775807 >> -9223372036854775808 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 >> 2147483647 ---
+int(0)
+--- testing: 9223372036854775807 >> -2147483648 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 >> 9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 >> -9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 >> 2147483648 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 >> -2147483649 ---
+int(0)
+--- testing: 9223372036854775807 >> 4294967294 ---
+int(1)
+--- testing: 9223372036854775807 >> 4294967295 ---
+int(0)
+--- testing: 9223372036854775807 >> 4294967293 ---
+int(3)
+--- testing: 9223372036854775807 >> 9223372036854775806 ---
+int(1)
+--- testing: 9223372036854775807 >> 9.2233720368548E+18 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 >> -9223372036854775807 ---
+int(4611686018427387903)
+--- testing: 9223372036854775807 >> -9.2233720368548E+18 ---
+int(9223372036854775807)
+===DONE===
+ \ No newline at end of file
diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
new file mode 100644
index 0000000..9518d42
--- /dev/null
+++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test >> operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' >> '$otherVal' ---\n";
+ var_dump(bin2hex($strVal>>$otherVal));
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' >> '0' ---
+string(2) "30"
+--- testing: '0' >> '65' ---
+string(2) "30"
+--- testing: '0' >> '-44' ---
+string(2) "30"
+--- testing: '0' >> '1.2' ---
+string(2) "30"
+--- testing: '0' >> '-7.7' ---
+string(2) "30"
+--- testing: '0' >> 'abc' ---
+string(2) "30"
+--- testing: '0' >> '123abc' ---
+string(2) "30"
+--- testing: '0' >> '123e5' ---
+string(2) "30"
+--- testing: '0' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '0' >> ' 123abc' ---
+string(2) "30"
+--- testing: '0' >> '123 abc' ---
+string(2) "30"
+--- testing: '0' >> '123abc ' ---
+string(2) "30"
+--- testing: '0' >> '3.4a' ---
+string(2) "30"
+--- testing: '0' >> 'a5.9' ---
+string(2) "30"
+--- testing: '65' >> '0' ---
+string(4) "3635"
+--- testing: '65' >> '65' ---
+string(4) "3332"
+--- testing: '65' >> '-44' ---
+string(2) "30"
+--- testing: '65' >> '1.2' ---
+string(4) "3332"
+--- testing: '65' >> '-7.7' ---
+string(2) "30"
+--- testing: '65' >> 'abc' ---
+string(4) "3635"
+--- testing: '65' >> '123abc' ---
+string(2) "30"
+--- testing: '65' >> '123e5' ---
+string(2) "30"
+--- testing: '65' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '65' >> ' 123abc' ---
+string(2) "30"
+--- testing: '65' >> '123 abc' ---
+string(2) "30"
+--- testing: '65' >> '123abc ' ---
+string(2) "30"
+--- testing: '65' >> '3.4a' ---
+string(2) "38"
+--- testing: '65' >> 'a5.9' ---
+string(4) "3635"
+--- testing: '-44' >> '0' ---
+string(6) "2d3434"
+--- testing: '-44' >> '65' ---
+string(6) "2d3232"
+--- testing: '-44' >> '-44' ---
+string(4) "2d31"
+--- testing: '-44' >> '1.2' ---
+string(6) "2d3232"
+--- testing: '-44' >> '-7.7' ---
+string(4) "2d31"
+--- testing: '-44' >> 'abc' ---
+string(6) "2d3434"
+--- testing: '-44' >> '123abc' ---
+string(4) "2d31"
+--- testing: '-44' >> '123e5' ---
+string(4) "2d31"
+--- testing: '-44' >> '123e5xyz' ---
+string(4) "2d31"
+--- testing: '-44' >> ' 123abc' ---
+string(4) "2d31"
+--- testing: '-44' >> '123 abc' ---
+string(4) "2d31"
+--- testing: '-44' >> '123abc ' ---
+string(4) "2d31"
+--- testing: '-44' >> '3.4a' ---
+string(4) "2d36"
+--- testing: '-44' >> 'a5.9' ---
+string(6) "2d3434"
+--- testing: '1.2' >> '0' ---
+string(2) "31"
+--- testing: '1.2' >> '65' ---
+string(2) "30"
+--- testing: '1.2' >> '-44' ---
+string(2) "30"
+--- testing: '1.2' >> '1.2' ---
+string(2) "30"
+--- testing: '1.2' >> '-7.7' ---
+string(2) "30"
+--- testing: '1.2' >> 'abc' ---
+string(2) "31"
+--- testing: '1.2' >> '123abc' ---
+string(2) "30"
+--- testing: '1.2' >> '123e5' ---
+string(2) "30"
+--- testing: '1.2' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '1.2' >> ' 123abc' ---
+string(2) "30"
+--- testing: '1.2' >> '123 abc' ---
+string(2) "30"
+--- testing: '1.2' >> '123abc ' ---
+string(2) "30"
+--- testing: '1.2' >> '3.4a' ---
+string(2) "30"
+--- testing: '1.2' >> 'a5.9' ---
+string(2) "31"
+--- testing: '-7.7' >> '0' ---
+string(4) "2d37"
+--- testing: '-7.7' >> '65' ---
+string(4) "2d34"
+--- testing: '-7.7' >> '-44' ---
+string(4) "2d31"
+--- testing: '-7.7' >> '1.2' ---
+string(4) "2d34"
+--- testing: '-7.7' >> '-7.7' ---
+string(4) "2d31"
+--- testing: '-7.7' >> 'abc' ---
+string(4) "2d37"
+--- testing: '-7.7' >> '123abc' ---
+string(4) "2d31"
+--- testing: '-7.7' >> '123e5' ---
+string(4) "2d31"
+--- testing: '-7.7' >> '123e5xyz' ---
+string(4) "2d31"
+--- testing: '-7.7' >> ' 123abc' ---
+string(4) "2d31"
+--- testing: '-7.7' >> '123 abc' ---
+string(4) "2d31"
+--- testing: '-7.7' >> '123abc ' ---
+string(4) "2d31"
+--- testing: '-7.7' >> '3.4a' ---
+string(4) "2d31"
+--- testing: '-7.7' >> 'a5.9' ---
+string(4) "2d37"
+--- testing: 'abc' >> '0' ---
+string(2) "30"
+--- testing: 'abc' >> '65' ---
+string(2) "30"
+--- testing: 'abc' >> '-44' ---
+string(2) "30"
+--- testing: 'abc' >> '1.2' ---
+string(2) "30"
+--- testing: 'abc' >> '-7.7' ---
+string(2) "30"
+--- testing: 'abc' >> 'abc' ---
+string(2) "30"
+--- testing: 'abc' >> '123abc' ---
+string(2) "30"
+--- testing: 'abc' >> '123e5' ---
+string(2) "30"
+--- testing: 'abc' >> '123e5xyz' ---
+string(2) "30"
+--- testing: 'abc' >> ' 123abc' ---
+string(2) "30"
+--- testing: 'abc' >> '123 abc' ---
+string(2) "30"
+--- testing: 'abc' >> '123abc ' ---
+string(2) "30"
+--- testing: 'abc' >> '3.4a' ---
+string(2) "30"
+--- testing: 'abc' >> 'a5.9' ---
+string(2) "30"
+--- testing: '123abc' >> '0' ---
+string(6) "313233"
+--- testing: '123abc' >> '65' ---
+string(4) "3631"
+--- testing: '123abc' >> '-44' ---
+string(2) "30"
+--- testing: '123abc' >> '1.2' ---
+string(4) "3631"
+--- testing: '123abc' >> '-7.7' ---
+string(2) "30"
+--- testing: '123abc' >> 'abc' ---
+string(6) "313233"
+--- testing: '123abc' >> '123abc' ---
+string(2) "30"
+--- testing: '123abc' >> '123e5' ---
+string(2) "30"
+--- testing: '123abc' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '123abc' >> ' 123abc' ---
+string(2) "30"
+--- testing: '123abc' >> '123 abc' ---
+string(2) "30"
+--- testing: '123abc' >> '123abc ' ---
+string(2) "30"
+--- testing: '123abc' >> '3.4a' ---
+string(4) "3135"
+--- testing: '123abc' >> 'a5.9' ---
+string(6) "313233"
+--- testing: '123e5' >> '0' ---
+string(6) "313233"
+--- testing: '123e5' >> '65' ---
+string(4) "3631"
+--- testing: '123e5' >> '-44' ---
+string(2) "30"
+--- testing: '123e5' >> '1.2' ---
+string(4) "3631"
+--- testing: '123e5' >> '-7.7' ---
+string(2) "30"
+--- testing: '123e5' >> 'abc' ---
+string(6) "313233"
+--- testing: '123e5' >> '123abc' ---
+string(2) "30"
+--- testing: '123e5' >> '123e5' ---
+string(2) "30"
+--- testing: '123e5' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '123e5' >> ' 123abc' ---
+string(2) "30"
+--- testing: '123e5' >> '123 abc' ---
+string(2) "30"
+--- testing: '123e5' >> '123abc ' ---
+string(2) "30"
+--- testing: '123e5' >> '3.4a' ---
+string(4) "3135"
+--- testing: '123e5' >> 'a5.9' ---
+string(6) "313233"
+--- testing: '123e5xyz' >> '0' ---
+string(6) "313233"
+--- testing: '123e5xyz' >> '65' ---
+string(4) "3631"
+--- testing: '123e5xyz' >> '-44' ---
+string(2) "30"
+--- testing: '123e5xyz' >> '1.2' ---
+string(4) "3631"
+--- testing: '123e5xyz' >> '-7.7' ---
+string(2) "30"
+--- testing: '123e5xyz' >> 'abc' ---
+string(6) "313233"
+--- testing: '123e5xyz' >> '123abc' ---
+string(2) "30"
+--- testing: '123e5xyz' >> '123e5' ---
+string(2) "30"
+--- testing: '123e5xyz' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '123e5xyz' >> ' 123abc' ---
+string(2) "30"
+--- testing: '123e5xyz' >> '123 abc' ---
+string(2) "30"
+--- testing: '123e5xyz' >> '123abc ' ---
+string(2) "30"
+--- testing: '123e5xyz' >> '3.4a' ---
+string(4) "3135"
+--- testing: '123e5xyz' >> 'a5.9' ---
+string(6) "313233"
+--- testing: ' 123abc' >> '0' ---
+string(6) "313233"
+--- testing: ' 123abc' >> '65' ---
+string(4) "3631"
+--- testing: ' 123abc' >> '-44' ---
+string(2) "30"
+--- testing: ' 123abc' >> '1.2' ---
+string(4) "3631"
+--- testing: ' 123abc' >> '-7.7' ---
+string(2) "30"
+--- testing: ' 123abc' >> 'abc' ---
+string(6) "313233"
+--- testing: ' 123abc' >> '123abc' ---
+string(2) "30"
+--- testing: ' 123abc' >> '123e5' ---
+string(2) "30"
+--- testing: ' 123abc' >> '123e5xyz' ---
+string(2) "30"
+--- testing: ' 123abc' >> ' 123abc' ---
+string(2) "30"
+--- testing: ' 123abc' >> '123 abc' ---
+string(2) "30"
+--- testing: ' 123abc' >> '123abc ' ---
+string(2) "30"
+--- testing: ' 123abc' >> '3.4a' ---
+string(4) "3135"
+--- testing: ' 123abc' >> 'a5.9' ---
+string(6) "313233"
+--- testing: '123 abc' >> '0' ---
+string(6) "313233"
+--- testing: '123 abc' >> '65' ---
+string(4) "3631"
+--- testing: '123 abc' >> '-44' ---
+string(2) "30"
+--- testing: '123 abc' >> '1.2' ---
+string(4) "3631"
+--- testing: '123 abc' >> '-7.7' ---
+string(2) "30"
+--- testing: '123 abc' >> 'abc' ---
+string(6) "313233"
+--- testing: '123 abc' >> '123abc' ---
+string(2) "30"
+--- testing: '123 abc' >> '123e5' ---
+string(2) "30"
+--- testing: '123 abc' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '123 abc' >> ' 123abc' ---
+string(2) "30"
+--- testing: '123 abc' >> '123 abc' ---
+string(2) "30"
+--- testing: '123 abc' >> '123abc ' ---
+string(2) "30"
+--- testing: '123 abc' >> '3.4a' ---
+string(4) "3135"
+--- testing: '123 abc' >> 'a5.9' ---
+string(6) "313233"
+--- testing: '123abc ' >> '0' ---
+string(6) "313233"
+--- testing: '123abc ' >> '65' ---
+string(4) "3631"
+--- testing: '123abc ' >> '-44' ---
+string(2) "30"
+--- testing: '123abc ' >> '1.2' ---
+string(4) "3631"
+--- testing: '123abc ' >> '-7.7' ---
+string(2) "30"
+--- testing: '123abc ' >> 'abc' ---
+string(6) "313233"
+--- testing: '123abc ' >> '123abc' ---
+string(2) "30"
+--- testing: '123abc ' >> '123e5' ---
+string(2) "30"
+--- testing: '123abc ' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '123abc ' >> ' 123abc' ---
+string(2) "30"
+--- testing: '123abc ' >> '123 abc' ---
+string(2) "30"
+--- testing: '123abc ' >> '123abc ' ---
+string(2) "30"
+--- testing: '123abc ' >> '3.4a' ---
+string(4) "3135"
+--- testing: '123abc ' >> 'a5.9' ---
+string(6) "313233"
+--- testing: '3.4a' >> '0' ---
+string(2) "33"
+--- testing: '3.4a' >> '65' ---
+string(2) "31"
+--- testing: '3.4a' >> '-44' ---
+string(2) "30"
+--- testing: '3.4a' >> '1.2' ---
+string(2) "31"
+--- testing: '3.4a' >> '-7.7' ---
+string(2) "30"
+--- testing: '3.4a' >> 'abc' ---
+string(2) "33"
+--- testing: '3.4a' >> '123abc' ---
+string(2) "30"
+--- testing: '3.4a' >> '123e5' ---
+string(2) "30"
+--- testing: '3.4a' >> '123e5xyz' ---
+string(2) "30"
+--- testing: '3.4a' >> ' 123abc' ---
+string(2) "30"
+--- testing: '3.4a' >> '123 abc' ---
+string(2) "30"
+--- testing: '3.4a' >> '123abc ' ---
+string(2) "30"
+--- testing: '3.4a' >> '3.4a' ---
+string(2) "30"
+--- testing: '3.4a' >> 'a5.9' ---
+string(2) "33"
+--- testing: 'a5.9' >> '0' ---
+string(2) "30"
+--- testing: 'a5.9' >> '65' ---
+string(2) "30"
+--- testing: 'a5.9' >> '-44' ---
+string(2) "30"
+--- testing: 'a5.9' >> '1.2' ---
+string(2) "30"
+--- testing: 'a5.9' >> '-7.7' ---
+string(2) "30"
+--- testing: 'a5.9' >> 'abc' ---
+string(2) "30"
+--- testing: 'a5.9' >> '123abc' ---
+string(2) "30"
+--- testing: 'a5.9' >> '123e5' ---
+string(2) "30"
+--- testing: 'a5.9' >> '123e5xyz' ---
+string(2) "30"
+--- testing: 'a5.9' >> ' 123abc' ---
+string(2) "30"
+--- testing: 'a5.9' >> '123 abc' ---
+string(2) "30"
+--- testing: 'a5.9' >> '123abc ' ---
+string(2) "30"
+--- testing: 'a5.9' >> '3.4a' ---
+string(2) "30"
+--- testing: 'a5.9' >> 'a5.9' ---
+string(2) "30"
+===DONE===
diff --git a/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt
new file mode 100644
index 0000000..2764be6
--- /dev/null
+++ b/tests/lang/operators/bitwiseXor_basiclong_64bit.phpt
@@ -0,0 +1,583 @@
+--TEST--
+Test ^ operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal ^ $otherVal ---\n";
+ var_dump($longVal^$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal ^ $longVal ---\n";
+ var_dump($otherVal^$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 ^ 0 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 ^ 1 ---
+int(9223372036854775806)
+--- testing: 9223372036854775807 ^ -1 ---
+int(-9223372036854775808)
+--- testing: 9223372036854775807 ^ 7 ---
+int(9223372036854775800)
+--- testing: 9223372036854775807 ^ 9 ---
+int(9223372036854775798)
+--- testing: 9223372036854775807 ^ 65 ---
+int(9223372036854775742)
+--- testing: 9223372036854775807 ^ -44 ---
+int(-9223372036854775765)
+--- testing: 9223372036854775807 ^ 2147483647 ---
+int(9223372034707292160)
+--- testing: 9223372036854775807 ^ 9223372036854775807 ---
+int(0)
+--- testing: -9223372036854775808 ^ 0 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 ^ 1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775808 ^ -1 ---
+int(9223372036854775807)
+--- testing: -9223372036854775808 ^ 7 ---
+int(-9223372036854775801)
+--- testing: -9223372036854775808 ^ 9 ---
+int(-9223372036854775799)
+--- testing: -9223372036854775808 ^ 65 ---
+int(-9223372036854775743)
+--- testing: -9223372036854775808 ^ -44 ---
+int(9223372036854775764)
+--- testing: -9223372036854775808 ^ 2147483647 ---
+int(-9223372034707292161)
+--- testing: -9223372036854775808 ^ 9223372036854775807 ---
+int(-1)
+--- testing: 2147483647 ^ 0 ---
+int(2147483647)
+--- testing: 2147483647 ^ 1 ---
+int(2147483646)
+--- testing: 2147483647 ^ -1 ---
+int(-2147483648)
+--- testing: 2147483647 ^ 7 ---
+int(2147483640)
+--- testing: 2147483647 ^ 9 ---
+int(2147483638)
+--- testing: 2147483647 ^ 65 ---
+int(2147483582)
+--- testing: 2147483647 ^ -44 ---
+int(-2147483605)
+--- testing: 2147483647 ^ 2147483647 ---
+int(0)
+--- testing: 2147483647 ^ 9223372036854775807 ---
+int(9223372034707292160)
+--- testing: -2147483648 ^ 0 ---
+int(-2147483648)
+--- testing: -2147483648 ^ 1 ---
+int(-2147483647)
+--- testing: -2147483648 ^ -1 ---
+int(2147483647)
+--- testing: -2147483648 ^ 7 ---
+int(-2147483641)
+--- testing: -2147483648 ^ 9 ---
+int(-2147483639)
+--- testing: -2147483648 ^ 65 ---
+int(-2147483583)
+--- testing: -2147483648 ^ -44 ---
+int(2147483604)
+--- testing: -2147483648 ^ 2147483647 ---
+int(-1)
+--- testing: -2147483648 ^ 9223372036854775807 ---
+int(-9223372034707292161)
+--- testing: 9223372034707292160 ^ 0 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 ^ 1 ---
+int(9223372034707292161)
+--- testing: 9223372034707292160 ^ -1 ---
+int(-9223372034707292161)
+--- testing: 9223372034707292160 ^ 7 ---
+int(9223372034707292167)
+--- testing: 9223372034707292160 ^ 9 ---
+int(9223372034707292169)
+--- testing: 9223372034707292160 ^ 65 ---
+int(9223372034707292225)
+--- testing: 9223372034707292160 ^ -44 ---
+int(-9223372034707292204)
+--- testing: 9223372034707292160 ^ 2147483647 ---
+int(9223372036854775807)
+--- testing: 9223372034707292160 ^ 9223372036854775807 ---
+int(2147483647)
+--- testing: -9223372034707292160 ^ 0 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 ^ 1 ---
+int(-9223372034707292159)
+--- testing: -9223372034707292160 ^ -1 ---
+int(9223372034707292159)
+--- testing: -9223372034707292160 ^ 7 ---
+int(-9223372034707292153)
+--- testing: -9223372034707292160 ^ 9 ---
+int(-9223372034707292151)
+--- testing: -9223372034707292160 ^ 65 ---
+int(-9223372034707292095)
+--- testing: -9223372034707292160 ^ -44 ---
+int(9223372034707292116)
+--- testing: -9223372034707292160 ^ 2147483647 ---
+int(-9223372032559808513)
+--- testing: -9223372034707292160 ^ 9223372036854775807 ---
+int(-2147483649)
+--- testing: 2147483648 ^ 0 ---
+int(2147483648)
+--- testing: 2147483648 ^ 1 ---
+int(2147483649)
+--- testing: 2147483648 ^ -1 ---
+int(-2147483649)
+--- testing: 2147483648 ^ 7 ---
+int(2147483655)
+--- testing: 2147483648 ^ 9 ---
+int(2147483657)
+--- testing: 2147483648 ^ 65 ---
+int(2147483713)
+--- testing: 2147483648 ^ -44 ---
+int(-2147483692)
+--- testing: 2147483648 ^ 2147483647 ---
+int(4294967295)
+--- testing: 2147483648 ^ 9223372036854775807 ---
+int(9223372034707292159)
+--- testing: -2147483649 ^ 0 ---
+int(-2147483649)
+--- testing: -2147483649 ^ 1 ---
+int(-2147483650)
+--- testing: -2147483649 ^ -1 ---
+int(2147483648)
+--- testing: -2147483649 ^ 7 ---
+int(-2147483656)
+--- testing: -2147483649 ^ 9 ---
+int(-2147483658)
+--- testing: -2147483649 ^ 65 ---
+int(-2147483714)
+--- testing: -2147483649 ^ -44 ---
+int(2147483691)
+--- testing: -2147483649 ^ 2147483647 ---
+int(-4294967296)
+--- testing: -2147483649 ^ 9223372036854775807 ---
+int(-9223372034707292160)
+--- testing: 4294967294 ^ 0 ---
+int(4294967294)
+--- testing: 4294967294 ^ 1 ---
+int(4294967295)
+--- testing: 4294967294 ^ -1 ---
+int(-4294967295)
+--- testing: 4294967294 ^ 7 ---
+int(4294967289)
+--- testing: 4294967294 ^ 9 ---
+int(4294967287)
+--- testing: 4294967294 ^ 65 ---
+int(4294967231)
+--- testing: 4294967294 ^ -44 ---
+int(-4294967254)
+--- testing: 4294967294 ^ 2147483647 ---
+int(2147483649)
+--- testing: 4294967294 ^ 9223372036854775807 ---
+int(9223372032559808513)
+--- testing: 4294967295 ^ 0 ---
+int(4294967295)
+--- testing: 4294967295 ^ 1 ---
+int(4294967294)
+--- testing: 4294967295 ^ -1 ---
+int(-4294967296)
+--- testing: 4294967295 ^ 7 ---
+int(4294967288)
+--- testing: 4294967295 ^ 9 ---
+int(4294967286)
+--- testing: 4294967295 ^ 65 ---
+int(4294967230)
+--- testing: 4294967295 ^ -44 ---
+int(-4294967253)
+--- testing: 4294967295 ^ 2147483647 ---
+int(2147483648)
+--- testing: 4294967295 ^ 9223372036854775807 ---
+int(9223372032559808512)
+--- testing: 4294967293 ^ 0 ---
+int(4294967293)
+--- testing: 4294967293 ^ 1 ---
+int(4294967292)
+--- testing: 4294967293 ^ -1 ---
+int(-4294967294)
+--- testing: 4294967293 ^ 7 ---
+int(4294967290)
+--- testing: 4294967293 ^ 9 ---
+int(4294967284)
+--- testing: 4294967293 ^ 65 ---
+int(4294967228)
+--- testing: 4294967293 ^ -44 ---
+int(-4294967255)
+--- testing: 4294967293 ^ 2147483647 ---
+int(2147483650)
+--- testing: 4294967293 ^ 9223372036854775807 ---
+int(9223372032559808514)
+--- testing: 9223372036854775806 ^ 0 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 ^ 1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 ^ -1 ---
+int(-9223372036854775807)
+--- testing: 9223372036854775806 ^ 7 ---
+int(9223372036854775801)
+--- testing: 9223372036854775806 ^ 9 ---
+int(9223372036854775799)
+--- testing: 9223372036854775806 ^ 65 ---
+int(9223372036854775743)
+--- testing: 9223372036854775806 ^ -44 ---
+int(-9223372036854775766)
+--- testing: 9223372036854775806 ^ 2147483647 ---
+int(9223372034707292161)
+--- testing: 9223372036854775806 ^ 9223372036854775807 ---
+int(1)
+--- testing: 9.2233720368548E+18 ^ 0 ---
+int(-9223372036854775808)
+--- testing: 9.2233720368548E+18 ^ 1 ---
+int(-9223372036854775807)
+--- testing: 9.2233720368548E+18 ^ -1 ---
+int(9223372036854775807)
+--- testing: 9.2233720368548E+18 ^ 7 ---
+int(-9223372036854775801)
+--- testing: 9.2233720368548E+18 ^ 9 ---
+int(-9223372036854775799)
+--- testing: 9.2233720368548E+18 ^ 65 ---
+int(-9223372036854775743)
+--- testing: 9.2233720368548E+18 ^ -44 ---
+int(9223372036854775764)
+--- testing: 9.2233720368548E+18 ^ 2147483647 ---
+int(-9223372034707292161)
+--- testing: 9.2233720368548E+18 ^ 9223372036854775807 ---
+int(-1)
+--- testing: -9223372036854775807 ^ 0 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 ^ 1 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775807 ^ -1 ---
+int(9223372036854775806)
+--- testing: -9223372036854775807 ^ 7 ---
+int(-9223372036854775802)
+--- testing: -9223372036854775807 ^ 9 ---
+int(-9223372036854775800)
+--- testing: -9223372036854775807 ^ 65 ---
+int(-9223372036854775744)
+--- testing: -9223372036854775807 ^ -44 ---
+int(9223372036854775765)
+--- testing: -9223372036854775807 ^ 2147483647 ---
+int(-9223372034707292162)
+--- testing: -9223372036854775807 ^ 9223372036854775807 ---
+int(-2)
+--- testing: -9.2233720368548E+18 ^ 0 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 ^ 1 ---
+int(-9223372036854775807)
+--- testing: -9.2233720368548E+18 ^ -1 ---
+int(9223372036854775807)
+--- testing: -9.2233720368548E+18 ^ 7 ---
+int(-9223372036854775801)
+--- testing: -9.2233720368548E+18 ^ 9 ---
+int(-9223372036854775799)
+--- testing: -9.2233720368548E+18 ^ 65 ---
+int(-9223372036854775743)
+--- testing: -9.2233720368548E+18 ^ -44 ---
+int(9223372036854775764)
+--- testing: -9.2233720368548E+18 ^ 2147483647 ---
+int(-9223372034707292161)
+--- testing: -9.2233720368548E+18 ^ 9223372036854775807 ---
+int(-1)
+--- testing: 0 ^ 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 0 ^ -9223372036854775808 ---
+int(-9223372036854775808)
+--- testing: 0 ^ 2147483647 ---
+int(2147483647)
+--- testing: 0 ^ -2147483648 ---
+int(-2147483648)
+--- testing: 0 ^ 9223372034707292160 ---
+int(9223372034707292160)
+--- testing: 0 ^ -9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: 0 ^ 2147483648 ---
+int(2147483648)
+--- testing: 0 ^ -2147483649 ---
+int(-2147483649)
+--- testing: 0 ^ 4294967294 ---
+int(4294967294)
+--- testing: 0 ^ 4294967295 ---
+int(4294967295)
+--- testing: 0 ^ 4294967293 ---
+int(4294967293)
+--- testing: 0 ^ 9223372036854775806 ---
+int(9223372036854775806)
+--- testing: 0 ^ 9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: 0 ^ -9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: 0 ^ -9.2233720368548E+18 ---
+int(-9223372036854775808)
+--- testing: 1 ^ 9223372036854775807 ---
+int(9223372036854775806)
+--- testing: 1 ^ -9223372036854775808 ---
+int(-9223372036854775807)
+--- testing: 1 ^ 2147483647 ---
+int(2147483646)
+--- testing: 1 ^ -2147483648 ---
+int(-2147483647)
+--- testing: 1 ^ 9223372034707292160 ---
+int(9223372034707292161)
+--- testing: 1 ^ -9223372034707292160 ---
+int(-9223372034707292159)
+--- testing: 1 ^ 2147483648 ---
+int(2147483649)
+--- testing: 1 ^ -2147483649 ---
+int(-2147483650)
+--- testing: 1 ^ 4294967294 ---
+int(4294967295)
+--- testing: 1 ^ 4294967295 ---
+int(4294967294)
+--- testing: 1 ^ 4294967293 ---
+int(4294967292)
+--- testing: 1 ^ 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 1 ^ 9.2233720368548E+18 ---
+int(-9223372036854775807)
+--- testing: 1 ^ -9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: 1 ^ -9.2233720368548E+18 ---
+int(-9223372036854775807)
+--- testing: -1 ^ 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -1 ^ -9223372036854775808 ---
+int(9223372036854775807)
+--- testing: -1 ^ 2147483647 ---
+int(-2147483648)
+--- testing: -1 ^ -2147483648 ---
+int(2147483647)
+--- testing: -1 ^ 9223372034707292160 ---
+int(-9223372034707292161)
+--- testing: -1 ^ -9223372034707292160 ---
+int(9223372034707292159)
+--- testing: -1 ^ 2147483648 ---
+int(-2147483649)
+--- testing: -1 ^ -2147483649 ---
+int(2147483648)
+--- testing: -1 ^ 4294967294 ---
+int(-4294967295)
+--- testing: -1 ^ 4294967295 ---
+int(-4294967296)
+--- testing: -1 ^ 4294967293 ---
+int(-4294967294)
+--- testing: -1 ^ 9223372036854775806 ---
+int(-9223372036854775807)
+--- testing: -1 ^ 9.2233720368548E+18 ---
+int(9223372036854775807)
+--- testing: -1 ^ -9223372036854775807 ---
+int(9223372036854775806)
+--- testing: -1 ^ -9.2233720368548E+18 ---
+int(9223372036854775807)
+--- testing: 7 ^ 9223372036854775807 ---
+int(9223372036854775800)
+--- testing: 7 ^ -9223372036854775808 ---
+int(-9223372036854775801)
+--- testing: 7 ^ 2147483647 ---
+int(2147483640)
+--- testing: 7 ^ -2147483648 ---
+int(-2147483641)
+--- testing: 7 ^ 9223372034707292160 ---
+int(9223372034707292167)
+--- testing: 7 ^ -9223372034707292160 ---
+int(-9223372034707292153)
+--- testing: 7 ^ 2147483648 ---
+int(2147483655)
+--- testing: 7 ^ -2147483649 ---
+int(-2147483656)
+--- testing: 7 ^ 4294967294 ---
+int(4294967289)
+--- testing: 7 ^ 4294967295 ---
+int(4294967288)
+--- testing: 7 ^ 4294967293 ---
+int(4294967290)
+--- testing: 7 ^ 9223372036854775806 ---
+int(9223372036854775801)
+--- testing: 7 ^ 9.2233720368548E+18 ---
+int(-9223372036854775801)
+--- testing: 7 ^ -9223372036854775807 ---
+int(-9223372036854775802)
+--- testing: 7 ^ -9.2233720368548E+18 ---
+int(-9223372036854775801)
+--- testing: 9 ^ 9223372036854775807 ---
+int(9223372036854775798)
+--- testing: 9 ^ -9223372036854775808 ---
+int(-9223372036854775799)
+--- testing: 9 ^ 2147483647 ---
+int(2147483638)
+--- testing: 9 ^ -2147483648 ---
+int(-2147483639)
+--- testing: 9 ^ 9223372034707292160 ---
+int(9223372034707292169)
+--- testing: 9 ^ -9223372034707292160 ---
+int(-9223372034707292151)
+--- testing: 9 ^ 2147483648 ---
+int(2147483657)
+--- testing: 9 ^ -2147483649 ---
+int(-2147483658)
+--- testing: 9 ^ 4294967294 ---
+int(4294967287)
+--- testing: 9 ^ 4294967295 ---
+int(4294967286)
+--- testing: 9 ^ 4294967293 ---
+int(4294967284)
+--- testing: 9 ^ 9223372036854775806 ---
+int(9223372036854775799)
+--- testing: 9 ^ 9.2233720368548E+18 ---
+int(-9223372036854775799)
+--- testing: 9 ^ -9223372036854775807 ---
+int(-9223372036854775800)
+--- testing: 9 ^ -9.2233720368548E+18 ---
+int(-9223372036854775799)
+--- testing: 65 ^ 9223372036854775807 ---
+int(9223372036854775742)
+--- testing: 65 ^ -9223372036854775808 ---
+int(-9223372036854775743)
+--- testing: 65 ^ 2147483647 ---
+int(2147483582)
+--- testing: 65 ^ -2147483648 ---
+int(-2147483583)
+--- testing: 65 ^ 9223372034707292160 ---
+int(9223372034707292225)
+--- testing: 65 ^ -9223372034707292160 ---
+int(-9223372034707292095)
+--- testing: 65 ^ 2147483648 ---
+int(2147483713)
+--- testing: 65 ^ -2147483649 ---
+int(-2147483714)
+--- testing: 65 ^ 4294967294 ---
+int(4294967231)
+--- testing: 65 ^ 4294967295 ---
+int(4294967230)
+--- testing: 65 ^ 4294967293 ---
+int(4294967228)
+--- testing: 65 ^ 9223372036854775806 ---
+int(9223372036854775743)
+--- testing: 65 ^ 9.2233720368548E+18 ---
+int(-9223372036854775743)
+--- testing: 65 ^ -9223372036854775807 ---
+int(-9223372036854775744)
+--- testing: 65 ^ -9.2233720368548E+18 ---
+int(-9223372036854775743)
+--- testing: -44 ^ 9223372036854775807 ---
+int(-9223372036854775765)
+--- testing: -44 ^ -9223372036854775808 ---
+int(9223372036854775764)
+--- testing: -44 ^ 2147483647 ---
+int(-2147483605)
+--- testing: -44 ^ -2147483648 ---
+int(2147483604)
+--- testing: -44 ^ 9223372034707292160 ---
+int(-9223372034707292204)
+--- testing: -44 ^ -9223372034707292160 ---
+int(9223372034707292116)
+--- testing: -44 ^ 2147483648 ---
+int(-2147483692)
+--- testing: -44 ^ -2147483649 ---
+int(2147483691)
+--- testing: -44 ^ 4294967294 ---
+int(-4294967254)
+--- testing: -44 ^ 4294967295 ---
+int(-4294967253)
+--- testing: -44 ^ 4294967293 ---
+int(-4294967255)
+--- testing: -44 ^ 9223372036854775806 ---
+int(-9223372036854775766)
+--- testing: -44 ^ 9.2233720368548E+18 ---
+int(9223372036854775764)
+--- testing: -44 ^ -9223372036854775807 ---
+int(9223372036854775765)
+--- testing: -44 ^ -9.2233720368548E+18 ---
+int(9223372036854775764)
+--- testing: 2147483647 ^ 9223372036854775807 ---
+int(9223372034707292160)
+--- testing: 2147483647 ^ -9223372036854775808 ---
+int(-9223372034707292161)
+--- testing: 2147483647 ^ 2147483647 ---
+int(0)
+--- testing: 2147483647 ^ -2147483648 ---
+int(-1)
+--- testing: 2147483647 ^ 9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 2147483647 ^ -9223372034707292160 ---
+int(-9223372032559808513)
+--- testing: 2147483647 ^ 2147483648 ---
+int(4294967295)
+--- testing: 2147483647 ^ -2147483649 ---
+int(-4294967296)
+--- testing: 2147483647 ^ 4294967294 ---
+int(2147483649)
+--- testing: 2147483647 ^ 4294967295 ---
+int(2147483648)
+--- testing: 2147483647 ^ 4294967293 ---
+int(2147483650)
+--- testing: 2147483647 ^ 9223372036854775806 ---
+int(9223372034707292161)
+--- testing: 2147483647 ^ 9.2233720368548E+18 ---
+int(-9223372034707292161)
+--- testing: 2147483647 ^ -9223372036854775807 ---
+int(-9223372034707292162)
+--- testing: 2147483647 ^ -9.2233720368548E+18 ---
+int(-9223372034707292161)
+--- testing: 9223372036854775807 ^ 9223372036854775807 ---
+int(0)
+--- testing: 9223372036854775807 ^ -9223372036854775808 ---
+int(-1)
+--- testing: 9223372036854775807 ^ 2147483647 ---
+int(9223372034707292160)
+--- testing: 9223372036854775807 ^ -2147483648 ---
+int(-9223372034707292161)
+--- testing: 9223372036854775807 ^ 9223372034707292160 ---
+int(2147483647)
+--- testing: 9223372036854775807 ^ -9223372034707292160 ---
+int(-2147483649)
+--- testing: 9223372036854775807 ^ 2147483648 ---
+int(9223372034707292159)
+--- testing: 9223372036854775807 ^ -2147483649 ---
+int(-9223372034707292160)
+--- testing: 9223372036854775807 ^ 4294967294 ---
+int(9223372032559808513)
+--- testing: 9223372036854775807 ^ 4294967295 ---
+int(9223372032559808512)
+--- testing: 9223372036854775807 ^ 4294967293 ---
+int(9223372032559808514)
+--- testing: 9223372036854775807 ^ 9223372036854775806 ---
+int(1)
+--- testing: 9223372036854775807 ^ 9.2233720368548E+18 ---
+int(-1)
+--- testing: 9223372036854775807 ^ -9223372036854775807 ---
+int(-2)
+--- testing: 9223372036854775807 ^ -9.2233720368548E+18 ---
+int(-1)
+===DONE===
+ \ No newline at end of file
diff --git a/tests/lang/operators/bitwiseXor_variationStr.phpt b/tests/lang/operators/bitwiseXor_variationStr.phpt
new file mode 100644
index 0000000..7dda659
--- /dev/null
+++ b/tests/lang/operators/bitwiseXor_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test ^ operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' ^ '$otherVal' ---\n";
+ var_dump(bin2hex($strVal^$otherVal));
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' ^ '0' ---
+string(2) "00"
+--- testing: '0' ^ '65' ---
+string(2) "06"
+--- testing: '0' ^ '-44' ---
+string(2) "1d"
+--- testing: '0' ^ '1.2' ---
+string(2) "01"
+--- testing: '0' ^ '-7.7' ---
+string(2) "1d"
+--- testing: '0' ^ 'abc' ---
+string(2) "51"
+--- testing: '0' ^ '123abc' ---
+string(2) "01"
+--- testing: '0' ^ '123e5' ---
+string(2) "01"
+--- testing: '0' ^ '123e5xyz' ---
+string(2) "01"
+--- testing: '0' ^ ' 123abc' ---
+string(2) "10"
+--- testing: '0' ^ '123 abc' ---
+string(2) "01"
+--- testing: '0' ^ '123abc ' ---
+string(2) "01"
+--- testing: '0' ^ '3.4a' ---
+string(2) "03"
+--- testing: '0' ^ 'a5.9' ---
+string(2) "51"
+--- testing: '65' ^ '0' ---
+string(2) "06"
+--- testing: '65' ^ '65' ---
+string(4) "0000"
+--- testing: '65' ^ '-44' ---
+string(4) "1b01"
+--- testing: '65' ^ '1.2' ---
+string(4) "071b"
+--- testing: '65' ^ '-7.7' ---
+string(4) "1b02"
+--- testing: '65' ^ 'abc' ---
+string(4) "5757"
+--- testing: '65' ^ '123abc' ---
+string(4) "0707"
+--- testing: '65' ^ '123e5' ---
+string(4) "0707"
+--- testing: '65' ^ '123e5xyz' ---
+string(4) "0707"
+--- testing: '65' ^ ' 123abc' ---
+string(4) "1604"
+--- testing: '65' ^ '123 abc' ---
+string(4) "0707"
+--- testing: '65' ^ '123abc ' ---
+string(4) "0707"
+--- testing: '65' ^ '3.4a' ---
+string(4) "051b"
+--- testing: '65' ^ 'a5.9' ---
+string(4) "5700"
+--- testing: '-44' ^ '0' ---
+string(2) "1d"
+--- testing: '-44' ^ '65' ---
+string(4) "1b01"
+--- testing: '-44' ^ '-44' ---
+string(6) "000000"
+--- testing: '-44' ^ '1.2' ---
+string(6) "1c1a06"
+--- testing: '-44' ^ '-7.7' ---
+string(6) "00031a"
+--- testing: '-44' ^ 'abc' ---
+string(6) "4c5657"
+--- testing: '-44' ^ '123abc' ---
+string(6) "1c0607"
+--- testing: '-44' ^ '123e5' ---
+string(6) "1c0607"
+--- testing: '-44' ^ '123e5xyz' ---
+string(6) "1c0607"
+--- testing: '-44' ^ ' 123abc' ---
+string(6) "0d0506"
+--- testing: '-44' ^ '123 abc' ---
+string(6) "1c0607"
+--- testing: '-44' ^ '123abc ' ---
+string(6) "1c0607"
+--- testing: '-44' ^ '3.4a' ---
+string(6) "1e1a00"
+--- testing: '-44' ^ 'a5.9' ---
+string(6) "4c011a"
+--- testing: '1.2' ^ '0' ---
+string(2) "01"
+--- testing: '1.2' ^ '65' ---
+string(4) "071b"
+--- testing: '1.2' ^ '-44' ---
+string(6) "1c1a06"
+--- testing: '1.2' ^ '1.2' ---
+string(6) "000000"
+--- testing: '1.2' ^ '-7.7' ---
+string(6) "1c191c"
+--- testing: '1.2' ^ 'abc' ---
+string(6) "504c51"
+--- testing: '1.2' ^ '123abc' ---
+string(6) "001c01"
+--- testing: '1.2' ^ '123e5' ---
+string(6) "001c01"
+--- testing: '1.2' ^ '123e5xyz' ---
+string(6) "001c01"
+--- testing: '1.2' ^ ' 123abc' ---
+string(6) "111f00"
+--- testing: '1.2' ^ '123 abc' ---
+string(6) "001c01"
+--- testing: '1.2' ^ '123abc ' ---
+string(6) "001c01"
+--- testing: '1.2' ^ '3.4a' ---
+string(6) "020006"
+--- testing: '1.2' ^ 'a5.9' ---
+string(6) "501b1c"
+--- testing: '-7.7' ^ '0' ---
+string(2) "1d"
+--- testing: '-7.7' ^ '65' ---
+string(4) "1b02"
+--- testing: '-7.7' ^ '-44' ---
+string(6) "00031a"
+--- testing: '-7.7' ^ '1.2' ---
+string(6) "1c191c"
+--- testing: '-7.7' ^ '-7.7' ---
+string(8) "00000000"
+--- testing: '-7.7' ^ 'abc' ---
+string(6) "4c554d"
+--- testing: '-7.7' ^ '123abc' ---
+string(8) "1c051d56"
+--- testing: '-7.7' ^ '123e5' ---
+string(8) "1c051d52"
+--- testing: '-7.7' ^ '123e5xyz' ---
+string(8) "1c051d52"
+--- testing: '-7.7' ^ ' 123abc' ---
+string(8) "0d061c04"
+--- testing: '-7.7' ^ '123 abc' ---
+string(8) "1c051d17"
+--- testing: '-7.7' ^ '123abc ' ---
+string(8) "1c051d56"
+--- testing: '-7.7' ^ '3.4a' ---
+string(8) "1e191a56"
+--- testing: '-7.7' ^ 'a5.9' ---
+string(8) "4c02000e"
+--- testing: 'abc' ^ '0' ---
+string(2) "51"
+--- testing: 'abc' ^ '65' ---
+string(4) "5757"
+--- testing: 'abc' ^ '-44' ---
+string(6) "4c5657"
+--- testing: 'abc' ^ '1.2' ---
+string(6) "504c51"
+--- testing: 'abc' ^ '-7.7' ---
+string(6) "4c554d"
+--- testing: 'abc' ^ 'abc' ---
+string(6) "000000"
+--- testing: 'abc' ^ '123abc' ---
+string(6) "505050"
+--- testing: 'abc' ^ '123e5' ---
+string(6) "505050"
+--- testing: 'abc' ^ '123e5xyz' ---
+string(6) "505050"
+--- testing: 'abc' ^ ' 123abc' ---
+string(6) "415351"
+--- testing: 'abc' ^ '123 abc' ---
+string(6) "505050"
+--- testing: 'abc' ^ '123abc ' ---
+string(6) "505050"
+--- testing: 'abc' ^ '3.4a' ---
+string(6) "524c57"
+--- testing: 'abc' ^ 'a5.9' ---
+string(6) "00574d"
+--- testing: '123abc' ^ '0' ---
+string(2) "01"
+--- testing: '123abc' ^ '65' ---
+string(4) "0707"
+--- testing: '123abc' ^ '-44' ---
+string(6) "1c0607"
+--- testing: '123abc' ^ '1.2' ---
+string(6) "001c01"
+--- testing: '123abc' ^ '-7.7' ---
+string(8) "1c051d56"
+--- testing: '123abc' ^ 'abc' ---
+string(6) "505050"
+--- testing: '123abc' ^ '123abc' ---
+string(12) "000000000000"
+--- testing: '123abc' ^ '123e5' ---
+string(10) "0000000457"
+--- testing: '123abc' ^ '123e5xyz' ---
+string(12) "00000004571b"
+--- testing: '123abc' ^ ' 123abc' ---
+string(12) "110301520301"
+--- testing: '123abc' ^ '123 abc' ---
+string(12) "000000410301"
+--- testing: '123abc' ^ '123abc ' ---
+string(12) "000000000000"
+--- testing: '123abc' ^ '3.4a' ---
+string(8) "021c0700"
+--- testing: '123abc' ^ 'a5.9' ---
+string(8) "50071d58"
+--- testing: '123e5' ^ '0' ---
+string(2) "01"
+--- testing: '123e5' ^ '65' ---
+string(4) "0707"
+--- testing: '123e5' ^ '-44' ---
+string(6) "1c0607"
+--- testing: '123e5' ^ '1.2' ---
+string(6) "001c01"
+--- testing: '123e5' ^ '-7.7' ---
+string(8) "1c051d52"
+--- testing: '123e5' ^ 'abc' ---
+string(6) "505050"
+--- testing: '123e5' ^ '123abc' ---
+string(10) "0000000457"
+--- testing: '123e5' ^ '123e5' ---
+string(10) "0000000000"
+--- testing: '123e5' ^ '123e5xyz' ---
+string(10) "0000000000"
+--- testing: '123e5' ^ ' 123abc' ---
+string(10) "1103015654"
+--- testing: '123e5' ^ '123 abc' ---
+string(10) "0000004554"
+--- testing: '123e5' ^ '123abc ' ---
+string(10) "0000000457"
+--- testing: '123e5' ^ '3.4a' ---
+string(8) "021c0704"
+--- testing: '123e5' ^ 'a5.9' ---
+string(8) "50071d5c"
+--- testing: '123e5xyz' ^ '0' ---
+string(2) "01"
+--- testing: '123e5xyz' ^ '65' ---
+string(4) "0707"
+--- testing: '123e5xyz' ^ '-44' ---
+string(6) "1c0607"
+--- testing: '123e5xyz' ^ '1.2' ---
+string(6) "001c01"
+--- testing: '123e5xyz' ^ '-7.7' ---
+string(8) "1c051d52"
+--- testing: '123e5xyz' ^ 'abc' ---
+string(6) "505050"
+--- testing: '123e5xyz' ^ '123abc' ---
+string(12) "00000004571b"
+--- testing: '123e5xyz' ^ '123e5' ---
+string(10) "0000000000"
+--- testing: '123e5xyz' ^ '123e5xyz' ---
+string(16) "0000000000000000"
+--- testing: '123e5xyz' ^ ' 123abc' ---
+string(14) "11030156541a1a"
+--- testing: '123e5xyz' ^ '123 abc' ---
+string(14) "00000045541a1a"
+--- testing: '123e5xyz' ^ '123abc ' ---
+string(14) "00000004571b59"
+--- testing: '123e5xyz' ^ '3.4a' ---
+string(8) "021c0704"
+--- testing: '123e5xyz' ^ 'a5.9' ---
+string(8) "50071d5c"
+--- testing: ' 123abc' ^ '0' ---
+string(2) "10"
+--- testing: ' 123abc' ^ '65' ---
+string(4) "1604"
+--- testing: ' 123abc' ^ '-44' ---
+string(6) "0d0506"
+--- testing: ' 123abc' ^ '1.2' ---
+string(6) "111f00"
+--- testing: ' 123abc' ^ '-7.7' ---
+string(8) "0d061c04"
+--- testing: ' 123abc' ^ 'abc' ---
+string(6) "415351"
+--- testing: ' 123abc' ^ '123abc' ---
+string(12) "110301520301"
+--- testing: ' 123abc' ^ '123e5' ---
+string(10) "1103015654"
+--- testing: ' 123abc' ^ '123e5xyz' ---
+string(14) "11030156541a1a"
+--- testing: ' 123abc' ^ ' 123abc' ---
+string(14) "00000000000000"
+--- testing: ' 123abc' ^ '123 abc' ---
+string(14) "11030113000000"
+--- testing: ' 123abc' ^ '123abc ' ---
+string(14) "11030152030143"
+--- testing: ' 123abc' ^ '3.4a' ---
+string(8) "131f0652"
+--- testing: ' 123abc' ^ 'a5.9' ---
+string(8) "41041c0a"
+--- testing: '123 abc' ^ '0' ---
+string(2) "01"
+--- testing: '123 abc' ^ '65' ---
+string(4) "0707"
+--- testing: '123 abc' ^ '-44' ---
+string(6) "1c0607"
+--- testing: '123 abc' ^ '1.2' ---
+string(6) "001c01"
+--- testing: '123 abc' ^ '-7.7' ---
+string(8) "1c051d17"
+--- testing: '123 abc' ^ 'abc' ---
+string(6) "505050"
+--- testing: '123 abc' ^ '123abc' ---
+string(12) "000000410301"
+--- testing: '123 abc' ^ '123e5' ---
+string(10) "0000004554"
+--- testing: '123 abc' ^ '123e5xyz' ---
+string(14) "00000045541a1a"
+--- testing: '123 abc' ^ ' 123abc' ---
+string(14) "11030113000000"
+--- testing: '123 abc' ^ '123 abc' ---
+string(14) "00000000000000"
+--- testing: '123 abc' ^ '123abc ' ---
+string(14) "00000041030143"
+--- testing: '123 abc' ^ '3.4a' ---
+string(8) "021c0741"
+--- testing: '123 abc' ^ 'a5.9' ---
+string(8) "50071d19"
+--- testing: '123abc ' ^ '0' ---
+string(2) "01"
+--- testing: '123abc ' ^ '65' ---
+string(4) "0707"
+--- testing: '123abc ' ^ '-44' ---
+string(6) "1c0607"
+--- testing: '123abc ' ^ '1.2' ---
+string(6) "001c01"
+--- testing: '123abc ' ^ '-7.7' ---
+string(8) "1c051d56"
+--- testing: '123abc ' ^ 'abc' ---
+string(6) "505050"
+--- testing: '123abc ' ^ '123abc' ---
+string(12) "000000000000"
+--- testing: '123abc ' ^ '123e5' ---
+string(10) "0000000457"
+--- testing: '123abc ' ^ '123e5xyz' ---
+string(14) "00000004571b59"
+--- testing: '123abc ' ^ ' 123abc' ---
+string(14) "11030152030143"
+--- testing: '123abc ' ^ '123 abc' ---
+string(14) "00000041030143"
+--- testing: '123abc ' ^ '123abc ' ---
+string(14) "00000000000000"
+--- testing: '123abc ' ^ '3.4a' ---
+string(8) "021c0700"
+--- testing: '123abc ' ^ 'a5.9' ---
+string(8) "50071d58"
+--- testing: '3.4a' ^ '0' ---
+string(2) "03"
+--- testing: '3.4a' ^ '65' ---
+string(4) "051b"
+--- testing: '3.4a' ^ '-44' ---
+string(6) "1e1a00"
+--- testing: '3.4a' ^ '1.2' ---
+string(6) "020006"
+--- testing: '3.4a' ^ '-7.7' ---
+string(8) "1e191a56"
+--- testing: '3.4a' ^ 'abc' ---
+string(6) "524c57"
+--- testing: '3.4a' ^ '123abc' ---
+string(8) "021c0700"
+--- testing: '3.4a' ^ '123e5' ---
+string(8) "021c0704"
+--- testing: '3.4a' ^ '123e5xyz' ---
+string(8) "021c0704"
+--- testing: '3.4a' ^ ' 123abc' ---
+string(8) "131f0652"
+--- testing: '3.4a' ^ '123 abc' ---
+string(8) "021c0741"
+--- testing: '3.4a' ^ '123abc ' ---
+string(8) "021c0700"
+--- testing: '3.4a' ^ '3.4a' ---
+string(8) "00000000"
+--- testing: '3.4a' ^ 'a5.9' ---
+string(8) "521b1a58"
+--- testing: 'a5.9' ^ '0' ---
+string(2) "51"
+--- testing: 'a5.9' ^ '65' ---
+string(4) "5700"
+--- testing: 'a5.9' ^ '-44' ---
+string(6) "4c011a"
+--- testing: 'a5.9' ^ '1.2' ---
+string(6) "501b1c"
+--- testing: 'a5.9' ^ '-7.7' ---
+string(8) "4c02000e"
+--- testing: 'a5.9' ^ 'abc' ---
+string(6) "00574d"
+--- testing: 'a5.9' ^ '123abc' ---
+string(8) "50071d58"
+--- testing: 'a5.9' ^ '123e5' ---
+string(8) "50071d5c"
+--- testing: 'a5.9' ^ '123e5xyz' ---
+string(8) "50071d5c"
+--- testing: 'a5.9' ^ ' 123abc' ---
+string(8) "41041c0a"
+--- testing: 'a5.9' ^ '123 abc' ---
+string(8) "50071d19"
+--- testing: 'a5.9' ^ '123abc ' ---
+string(8) "50071d58"
+--- testing: 'a5.9' ^ '3.4a' ---
+string(8) "521b1a58"
+--- testing: 'a5.9' ^ 'a5.9' ---
+string(8) "00000000"
+===DONE===
diff --git a/tests/lang/operators/divide_basiclong_64bit.phpt b/tests/lang/operators/divide_basiclong_64bit.phpt
new file mode 100644
index 0000000..b5d6df9
--- /dev/null
+++ b/tests/lang/operators/divide_basiclong_64bit.phpt
@@ -0,0 +1,582 @@
+--TEST--
+Test / operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal / $otherVal ---\n";
+ var_dump($longVal/$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal / $longVal ---\n";
+ var_dump($otherVal/$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 / 0 ---
+bool(false)
+--- testing: 9223372036854775807 / 1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 / -1 ---
+int(-9223372036854775807)
+--- testing: 9223372036854775807 / 7 ---
+int(1317624576693539401)
+--- testing: 9223372036854775807 / 9 ---
+float(1.0248191152061E+18)
+--- testing: 9223372036854775807 / 65 ---
+float(1.4189803133623E+17)
+--- testing: 9223372036854775807 / -44 ---
+float(-2.096220917467E+17)
+--- testing: 9223372036854775807 / 2147483647 ---
+float(4294967298)
+--- testing: 9223372036854775807 / 9223372036854775807 ---
+int(1)
+--- testing: -9223372036854775808 / 0 ---
+bool(false)
+--- testing: -9223372036854775808 / 1 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 / -1 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775808 / 7 ---
+float(-1.3176245766935E+18)
+--- testing: -9223372036854775808 / 9 ---
+float(-1.0248191152061E+18)
+--- testing: -9223372036854775808 / 65 ---
+float(-1.4189803133623E+17)
+--- testing: -9223372036854775808 / -44 ---
+float(2.096220917467E+17)
+--- testing: -9223372036854775808 / 2147483647 ---
+float(-4294967298)
+--- testing: -9223372036854775808 / 9223372036854775807 ---
+float(-1)
+--- testing: 2147483647 / 0 ---
+bool(false)
+--- testing: 2147483647 / 1 ---
+int(2147483647)
+--- testing: 2147483647 / -1 ---
+int(-2147483647)
+--- testing: 2147483647 / 7 ---
+float(306783378.14286)
+--- testing: 2147483647 / 9 ---
+float(238609294.11111)
+--- testing: 2147483647 / 65 ---
+float(33038209.953846)
+--- testing: 2147483647 / -44 ---
+float(-48806446.522727)
+--- testing: 2147483647 / 2147483647 ---
+int(1)
+--- testing: 2147483647 / 9223372036854775807 ---
+float(2.3283064354545E-10)
+--- testing: -2147483648 / 0 ---
+bool(false)
+--- testing: -2147483648 / 1 ---
+int(-2147483648)
+--- testing: -2147483648 / -1 ---
+int(2147483648)
+--- testing: -2147483648 / 7 ---
+float(-306783378.28571)
+--- testing: -2147483648 / 9 ---
+float(-238609294.22222)
+--- testing: -2147483648 / 65 ---
+float(-33038209.969231)
+--- testing: -2147483648 / -44 ---
+float(48806446.545455)
+--- testing: -2147483648 / 2147483647 ---
+float(-1.0000000004657)
+--- testing: -2147483648 / 9223372036854775807 ---
+float(-2.3283064365387E-10)
+--- testing: 9223372034707292160 / 0 ---
+bool(false)
+--- testing: 9223372034707292160 / 1 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 / -1 ---
+int(-9223372034707292160)
+--- testing: 9223372034707292160 / 7 ---
+float(1.3176245763868E+18)
+--- testing: 9223372034707292160 / 9 ---
+float(1.0248191149675E+18)
+--- testing: 9223372034707292160 / 65 ---
+float(1.4189803130319E+17)
+--- testing: 9223372034707292160 / -44 ---
+float(-2.0962209169789E+17)
+--- testing: 9223372034707292160 / 2147483647 ---
+float(4294967297)
+--- testing: 9223372034707292160 / 9223372036854775807 ---
+float(0.99999999976717)
+--- testing: -9223372034707292160 / 0 ---
+bool(false)
+--- testing: -9223372034707292160 / 1 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 / -1 ---
+int(9223372034707292160)
+--- testing: -9223372034707292160 / 7 ---
+float(-1.3176245763868E+18)
+--- testing: -9223372034707292160 / 9 ---
+float(-1.0248191149675E+18)
+--- testing: -9223372034707292160 / 65 ---
+float(-1.4189803130319E+17)
+--- testing: -9223372034707292160 / -44 ---
+float(2.0962209169789E+17)
+--- testing: -9223372034707292160 / 2147483647 ---
+float(-4294967297)
+--- testing: -9223372034707292160 / 9223372036854775807 ---
+float(-0.99999999976717)
+--- testing: 2147483648 / 0 ---
+bool(false)
+--- testing: 2147483648 / 1 ---
+int(2147483648)
+--- testing: 2147483648 / -1 ---
+int(-2147483648)
+--- testing: 2147483648 / 7 ---
+float(306783378.28571)
+--- testing: 2147483648 / 9 ---
+float(238609294.22222)
+--- testing: 2147483648 / 65 ---
+float(33038209.969231)
+--- testing: 2147483648 / -44 ---
+float(-48806446.545455)
+--- testing: 2147483648 / 2147483647 ---
+float(1.0000000004657)
+--- testing: 2147483648 / 9223372036854775807 ---
+float(2.3283064365387E-10)
+--- testing: -2147483649 / 0 ---
+bool(false)
+--- testing: -2147483649 / 1 ---
+int(-2147483649)
+--- testing: -2147483649 / -1 ---
+int(2147483649)
+--- testing: -2147483649 / 7 ---
+float(-306783378.42857)
+--- testing: -2147483649 / 9 ---
+float(-238609294.33333)
+--- testing: -2147483649 / 65 ---
+float(-33038209.984615)
+--- testing: -2147483649 / -44 ---
+float(48806446.568182)
+--- testing: -2147483649 / 2147483647 ---
+float(-1.0000000009313)
+--- testing: -2147483649 / 9223372036854775807 ---
+float(-2.3283064376229E-10)
+--- testing: 4294967294 / 0 ---
+bool(false)
+--- testing: 4294967294 / 1 ---
+int(4294967294)
+--- testing: 4294967294 / -1 ---
+int(-4294967294)
+--- testing: 4294967294 / 7 ---
+float(613566756.28571)
+--- testing: 4294967294 / 9 ---
+float(477218588.22222)
+--- testing: 4294967294 / 65 ---
+float(66076419.907692)
+--- testing: 4294967294 / -44 ---
+float(-97612893.045455)
+--- testing: 4294967294 / 2147483647 ---
+int(2)
+--- testing: 4294967294 / 9223372036854775807 ---
+float(4.656612870909E-10)
+--- testing: 4294967295 / 0 ---
+bool(false)
+--- testing: 4294967295 / 1 ---
+int(4294967295)
+--- testing: 4294967295 / -1 ---
+int(-4294967295)
+--- testing: 4294967295 / 7 ---
+float(613566756.42857)
+--- testing: 4294967295 / 9 ---
+float(477218588.33333)
+--- testing: 4294967295 / 65 ---
+float(66076419.923077)
+--- testing: 4294967295 / -44 ---
+float(-97612893.068182)
+--- testing: 4294967295 / 2147483647 ---
+float(2.0000000004657)
+--- testing: 4294967295 / 9223372036854775807 ---
+float(4.6566128719932E-10)
+--- testing: 4294967293 / 0 ---
+bool(false)
+--- testing: 4294967293 / 1 ---
+int(4294967293)
+--- testing: 4294967293 / -1 ---
+int(-4294967293)
+--- testing: 4294967293 / 7 ---
+float(613566756.14286)
+--- testing: 4294967293 / 9 ---
+float(477218588.11111)
+--- testing: 4294967293 / 65 ---
+float(66076419.892308)
+--- testing: 4294967293 / -44 ---
+float(-97612893.022727)
+--- testing: 4294967293 / 2147483647 ---
+float(1.9999999995343)
+--- testing: 4294967293 / 9223372036854775807 ---
+float(4.6566128698248E-10)
+--- testing: 9223372036854775806 / 0 ---
+bool(false)
+--- testing: 9223372036854775806 / 1 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 / -1 ---
+int(-9223372036854775806)
+--- testing: 9223372036854775806 / 7 ---
+float(1.3176245766935E+18)
+--- testing: 9223372036854775806 / 9 ---
+float(1.0248191152061E+18)
+--- testing: 9223372036854775806 / 65 ---
+float(1.4189803133623E+17)
+--- testing: 9223372036854775806 / -44 ---
+float(-2.096220917467E+17)
+--- testing: 9223372036854775806 / 2147483647 ---
+int(4294967298)
+--- testing: 9223372036854775806 / 9223372036854775807 ---
+float(1)
+--- testing: 9.2233720368548E+18 / 0 ---
+bool(false)
+--- testing: 9.2233720368548E+18 / 1 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 / -1 ---
+float(-9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 / 7 ---
+float(1.3176245766935E+18)
+--- testing: 9.2233720368548E+18 / 9 ---
+float(1.0248191152061E+18)
+--- testing: 9.2233720368548E+18 / 65 ---
+float(1.4189803133623E+17)
+--- testing: 9.2233720368548E+18 / -44 ---
+float(-2.096220917467E+17)
+--- testing: 9.2233720368548E+18 / 2147483647 ---
+float(4294967298)
+--- testing: 9.2233720368548E+18 / 9223372036854775807 ---
+float(1)
+--- testing: -9223372036854775807 / 0 ---
+bool(false)
+--- testing: -9223372036854775807 / 1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 / -1 ---
+int(9223372036854775807)
+--- testing: -9223372036854775807 / 7 ---
+int(-1317624576693539401)
+--- testing: -9223372036854775807 / 9 ---
+float(-1.0248191152061E+18)
+--- testing: -9223372036854775807 / 65 ---
+float(-1.4189803133623E+17)
+--- testing: -9223372036854775807 / -44 ---
+float(2.096220917467E+17)
+--- testing: -9223372036854775807 / 2147483647 ---
+float(-4294967298)
+--- testing: -9223372036854775807 / 9223372036854775807 ---
+int(-1)
+--- testing: -9.2233720368548E+18 / 0 ---
+bool(false)
+--- testing: -9.2233720368548E+18 / 1 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 / -1 ---
+float(9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 / 7 ---
+float(-1.3176245766935E+18)
+--- testing: -9.2233720368548E+18 / 9 ---
+float(-1.0248191152061E+18)
+--- testing: -9.2233720368548E+18 / 65 ---
+float(-1.4189803133623E+17)
+--- testing: -9.2233720368548E+18 / -44 ---
+float(2.096220917467E+17)
+--- testing: -9.2233720368548E+18 / 2147483647 ---
+float(-4294967298)
+--- testing: -9.2233720368548E+18 / 9223372036854775807 ---
+float(-1)
+--- testing: 0 / 9223372036854775807 ---
+int(0)
+--- testing: 0 / -9223372036854775808 ---
+int(0)
+--- testing: 0 / 2147483647 ---
+int(0)
+--- testing: 0 / -2147483648 ---
+int(0)
+--- testing: 0 / 9223372034707292160 ---
+int(0)
+--- testing: 0 / -9223372034707292160 ---
+int(0)
+--- testing: 0 / 2147483648 ---
+int(0)
+--- testing: 0 / -2147483649 ---
+int(0)
+--- testing: 0 / 4294967294 ---
+int(0)
+--- testing: 0 / 4294967295 ---
+int(0)
+--- testing: 0 / 4294967293 ---
+int(0)
+--- testing: 0 / 9223372036854775806 ---
+int(0)
+--- testing: 0 / 9.2233720368548E+18 ---
+float(0)
+--- testing: 0 / -9223372036854775807 ---
+int(0)
+--- testing: 0 / -9.2233720368548E+18 ---
+float(-0)
+--- testing: 1 / 9223372036854775807 ---
+float(1.0842021724855E-19)
+--- testing: 1 / -9223372036854775808 ---
+float(-1.0842021724855E-19)
+--- testing: 1 / 2147483647 ---
+float(4.6566128752458E-10)
+--- testing: 1 / -2147483648 ---
+float(-4.6566128730774E-10)
+--- testing: 1 / 9223372034707292160 ---
+float(1.0842021727379E-19)
+--- testing: 1 / -9223372034707292160 ---
+float(-1.0842021727379E-19)
+--- testing: 1 / 2147483648 ---
+float(4.6566128730774E-10)
+--- testing: 1 / -2147483649 ---
+float(-4.656612870909E-10)
+--- testing: 1 / 4294967294 ---
+float(2.3283064376229E-10)
+--- testing: 1 / 4294967295 ---
+float(2.3283064370808E-10)
+--- testing: 1 / 4294967293 ---
+float(2.328306438165E-10)
+--- testing: 1 / 9223372036854775806 ---
+float(1.0842021724855E-19)
+--- testing: 1 / 9.2233720368548E+18 ---
+float(1.0842021724855E-19)
+--- testing: 1 / -9223372036854775807 ---
+float(-1.0842021724855E-19)
+--- testing: 1 / -9.2233720368548E+18 ---
+float(-1.0842021724855E-19)
+--- testing: -1 / 9223372036854775807 ---
+float(-1.0842021724855E-19)
+--- testing: -1 / -9223372036854775808 ---
+float(1.0842021724855E-19)
+--- testing: -1 / 2147483647 ---
+float(-4.6566128752458E-10)
+--- testing: -1 / -2147483648 ---
+float(4.6566128730774E-10)
+--- testing: -1 / 9223372034707292160 ---
+float(-1.0842021727379E-19)
+--- testing: -1 / -9223372034707292160 ---
+float(1.0842021727379E-19)
+--- testing: -1 / 2147483648 ---
+float(-4.6566128730774E-10)
+--- testing: -1 / -2147483649 ---
+float(4.656612870909E-10)
+--- testing: -1 / 4294967294 ---
+float(-2.3283064376229E-10)
+--- testing: -1 / 4294967295 ---
+float(-2.3283064370808E-10)
+--- testing: -1 / 4294967293 ---
+float(-2.328306438165E-10)
+--- testing: -1 / 9223372036854775806 ---
+float(-1.0842021724855E-19)
+--- testing: -1 / 9.2233720368548E+18 ---
+float(-1.0842021724855E-19)
+--- testing: -1 / -9223372036854775807 ---
+float(1.0842021724855E-19)
+--- testing: -1 / -9.2233720368548E+18 ---
+float(1.0842021724855E-19)
+--- testing: 7 / 9223372036854775807 ---
+float(7.5894152073985E-19)
+--- testing: 7 / -9223372036854775808 ---
+float(-7.5894152073985E-19)
+--- testing: 7 / 2147483647 ---
+float(3.2596290126721E-9)
+--- testing: 7 / -2147483648 ---
+float(-3.2596290111542E-9)
+--- testing: 7 / 9223372034707292160 ---
+float(7.5894152091656E-19)
+--- testing: 7 / -9223372034707292160 ---
+float(-7.5894152091656E-19)
+--- testing: 7 / 2147483648 ---
+float(3.2596290111542E-9)
+--- testing: 7 / -2147483649 ---
+float(-3.2596290096363E-9)
+--- testing: 7 / 4294967294 ---
+float(1.629814506336E-9)
+--- testing: 7 / 4294967295 ---
+float(1.6298145059566E-9)
+--- testing: 7 / 4294967293 ---
+float(1.6298145067155E-9)
+--- testing: 7 / 9223372036854775806 ---
+float(7.5894152073985E-19)
+--- testing: 7 / 9.2233720368548E+18 ---
+float(7.5894152073985E-19)
+--- testing: 7 / -9223372036854775807 ---
+float(-7.5894152073985E-19)
+--- testing: 7 / -9.2233720368548E+18 ---
+float(-7.5894152073985E-19)
+--- testing: 9 / 9223372036854775807 ---
+float(9.7578195523695E-19)
+--- testing: 9 / -9223372036854775808 ---
+float(-9.7578195523695E-19)
+--- testing: 9 / 2147483647 ---
+float(4.1909515877212E-9)
+--- testing: 9 / -2147483648 ---
+float(-4.1909515857697E-9)
+--- testing: 9 / 9223372034707292160 ---
+float(9.7578195546415E-19)
+--- testing: 9 / -9223372034707292160 ---
+float(-9.7578195546415E-19)
+--- testing: 9 / 2147483648 ---
+float(4.1909515857697E-9)
+--- testing: 9 / -2147483649 ---
+float(-4.1909515838181E-9)
+--- testing: 9 / 4294967294 ---
+float(2.0954757938606E-9)
+--- testing: 9 / 4294967295 ---
+float(2.0954757933727E-9)
+--- testing: 9 / 4294967293 ---
+float(2.0954757943485E-9)
+--- testing: 9 / 9223372036854775806 ---
+float(9.7578195523695E-19)
+--- testing: 9 / 9.2233720368548E+18 ---
+float(9.7578195523695E-19)
+--- testing: 9 / -9223372036854775807 ---
+float(-9.7578195523695E-19)
+--- testing: 9 / -9.2233720368548E+18 ---
+float(-9.7578195523695E-19)
+--- testing: 65 / 9223372036854775807 ---
+float(7.0473141211558E-18)
+--- testing: 65 / -9223372036854775808 ---
+float(-7.0473141211558E-18)
+--- testing: 65 / 2147483647 ---
+float(3.0267983689098E-8)
+--- testing: 65 / -2147483648 ---
+float(-3.0267983675003E-8)
+--- testing: 65 / 9223372034707292160 ---
+float(7.0473141227966E-18)
+--- testing: 65 / -9223372034707292160 ---
+float(-7.0473141227966E-18)
+--- testing: 65 / 2147483648 ---
+float(3.0267983675003E-8)
+--- testing: 65 / -2147483649 ---
+float(-3.0267983660908E-8)
+--- testing: 65 / 4294967294 ---
+float(1.5133991844549E-8)
+--- testing: 65 / 4294967295 ---
+float(1.5133991841025E-8)
+--- testing: 65 / 4294967293 ---
+float(1.5133991848072E-8)
+--- testing: 65 / 9223372036854775806 ---
+float(7.0473141211558E-18)
+--- testing: 65 / 9.2233720368548E+18 ---
+float(7.0473141211558E-18)
+--- testing: 65 / -9223372036854775807 ---
+float(-7.0473141211558E-18)
+--- testing: 65 / -9.2233720368548E+18 ---
+float(-7.0473141211558E-18)
+--- testing: -44 / 9223372036854775807 ---
+float(-4.7704895589362E-18)
+--- testing: -44 / -9223372036854775808 ---
+float(4.7704895589362E-18)
+--- testing: -44 / 2147483647 ---
+float(-2.0489096651082E-8)
+--- testing: -44 / -2147483648 ---
+float(2.0489096641541E-8)
+--- testing: -44 / 9223372034707292160 ---
+float(-4.7704895600469E-18)
+--- testing: -44 / -9223372034707292160 ---
+float(4.7704895600469E-18)
+--- testing: -44 / 2147483648 ---
+float(-2.0489096641541E-8)
+--- testing: -44 / -2147483649 ---
+float(2.0489096632E-8)
+--- testing: -44 / 4294967294 ---
+float(-1.0244548325541E-8)
+--- testing: -44 / 4294967295 ---
+float(-1.0244548323156E-8)
+--- testing: -44 / 4294967293 ---
+float(-1.0244548327926E-8)
+--- testing: -44 / 9223372036854775806 ---
+float(-4.7704895589362E-18)
+--- testing: -44 / 9.2233720368548E+18 ---
+float(-4.7704895589362E-18)
+--- testing: -44 / -9223372036854775807 ---
+float(4.7704895589362E-18)
+--- testing: -44 / -9.2233720368548E+18 ---
+float(4.7704895589362E-18)
+--- testing: 2147483647 / 9223372036854775807 ---
+float(2.3283064354545E-10)
+--- testing: 2147483647 / -9223372036854775808 ---
+float(-2.3283064354545E-10)
+--- testing: 2147483647 / 2147483647 ---
+int(1)
+--- testing: 2147483647 / -2147483648 ---
+float(-0.99999999953434)
+--- testing: 2147483647 / 9223372034707292160 ---
+float(2.3283064359966E-10)
+--- testing: 2147483647 / -9223372034707292160 ---
+float(-2.3283064359966E-10)
+--- testing: 2147483647 / 2147483648 ---
+float(0.99999999953434)
+--- testing: 2147483647 / -2147483649 ---
+float(-0.99999999906868)
+--- testing: 2147483647 / 4294967294 ---
+float(0.5)
+--- testing: 2147483647 / 4294967295 ---
+float(0.49999999988358)
+--- testing: 2147483647 / 4294967293 ---
+float(0.50000000011642)
+--- testing: 2147483647 / 9223372036854775806 ---
+float(2.3283064354545E-10)
+--- testing: 2147483647 / 9.2233720368548E+18 ---
+float(2.3283064354545E-10)
+--- testing: 2147483647 / -9223372036854775807 ---
+float(-2.3283064354545E-10)
+--- testing: 2147483647 / -9.2233720368548E+18 ---
+float(-2.3283064354545E-10)
+--- testing: 9223372036854775807 / 9223372036854775807 ---
+int(1)
+--- testing: 9223372036854775807 / -9223372036854775808 ---
+float(-1)
+--- testing: 9223372036854775807 / 2147483647 ---
+float(4294967298)
+--- testing: 9223372036854775807 / -2147483648 ---
+float(-4294967296)
+--- testing: 9223372036854775807 / 9223372034707292160 ---
+float(1.0000000002328)
+--- testing: 9223372036854775807 / -9223372034707292160 ---
+float(-1.0000000002328)
+--- testing: 9223372036854775807 / 2147483648 ---
+float(4294967296)
+--- testing: 9223372036854775807 / -2147483649 ---
+float(-4294967294)
+--- testing: 9223372036854775807 / 4294967294 ---
+float(2147483649)
+--- testing: 9223372036854775807 / 4294967295 ---
+float(2147483648.5)
+--- testing: 9223372036854775807 / 4294967293 ---
+float(2147483649.5)
+--- testing: 9223372036854775807 / 9223372036854775806 ---
+float(1)
+--- testing: 9223372036854775807 / 9.2233720368548E+18 ---
+float(1)
+--- testing: 9223372036854775807 / -9223372036854775807 ---
+int(-1)
+--- testing: 9223372036854775807 / -9.2233720368548E+18 ---
+float(-1)
+===DONE===
diff --git a/tests/lang/operators/divide_variationStr.phpt b/tests/lang/operators/divide_variationStr.phpt
new file mode 100644
index 0000000..e48e9e1
--- /dev/null
+++ b/tests/lang/operators/divide_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test / operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' / '$otherVal' ---\n";
+ var_dump($strVal/$otherVal);
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' / '0' ---
+bool(false)
+--- testing: '0' / '65' ---
+int(0)
+--- testing: '0' / '-44' ---
+int(0)
+--- testing: '0' / '1.2' ---
+float(0)
+--- testing: '0' / '-7.7' ---
+float(-0)
+--- testing: '0' / 'abc' ---
+bool(false)
+--- testing: '0' / '123abc' ---
+int(0)
+--- testing: '0' / '123e5' ---
+float(0)
+--- testing: '0' / '123e5xyz' ---
+float(0)
+--- testing: '0' / ' 123abc' ---
+int(0)
+--- testing: '0' / '123 abc' ---
+int(0)
+--- testing: '0' / '123abc ' ---
+int(0)
+--- testing: '0' / '3.4a' ---
+float(0)
+--- testing: '0' / 'a5.9' ---
+bool(false)
+--- testing: '65' / '0' ---
+bool(false)
+--- testing: '65' / '65' ---
+int(1)
+--- testing: '65' / '-44' ---
+float(-1.4772727272727)
+--- testing: '65' / '1.2' ---
+float(54.166666666667)
+--- testing: '65' / '-7.7' ---
+float(-8.4415584415584)
+--- testing: '65' / 'abc' ---
+bool(false)
+--- testing: '65' / '123abc' ---
+float(0.52845528455285)
+--- testing: '65' / '123e5' ---
+float(5.2845528455285E-6)
+--- testing: '65' / '123e5xyz' ---
+float(5.2845528455285E-6)
+--- testing: '65' / ' 123abc' ---
+float(0.52845528455285)
+--- testing: '65' / '123 abc' ---
+float(0.52845528455285)
+--- testing: '65' / '123abc ' ---
+float(0.52845528455285)
+--- testing: '65' / '3.4a' ---
+float(19.117647058824)
+--- testing: '65' / 'a5.9' ---
+bool(false)
+--- testing: '-44' / '0' ---
+bool(false)
+--- testing: '-44' / '65' ---
+float(-0.67692307692308)
+--- testing: '-44' / '-44' ---
+int(1)
+--- testing: '-44' / '1.2' ---
+float(-36.666666666667)
+--- testing: '-44' / '-7.7' ---
+float(5.7142857142857)
+--- testing: '-44' / 'abc' ---
+bool(false)
+--- testing: '-44' / '123abc' ---
+float(-0.35772357723577)
+--- testing: '-44' / '123e5' ---
+float(-3.5772357723577E-6)
+--- testing: '-44' / '123e5xyz' ---
+float(-3.5772357723577E-6)
+--- testing: '-44' / ' 123abc' ---
+float(-0.35772357723577)
+--- testing: '-44' / '123 abc' ---
+float(-0.35772357723577)
+--- testing: '-44' / '123abc ' ---
+float(-0.35772357723577)
+--- testing: '-44' / '3.4a' ---
+float(-12.941176470588)
+--- testing: '-44' / 'a5.9' ---
+bool(false)
+--- testing: '1.2' / '0' ---
+bool(false)
+--- testing: '1.2' / '65' ---
+float(0.018461538461538)
+--- testing: '1.2' / '-44' ---
+float(-0.027272727272727)
+--- testing: '1.2' / '1.2' ---
+float(1)
+--- testing: '1.2' / '-7.7' ---
+float(-0.15584415584416)
+--- testing: '1.2' / 'abc' ---
+bool(false)
+--- testing: '1.2' / '123abc' ---
+float(0.0097560975609756)
+--- testing: '1.2' / '123e5' ---
+float(9.7560975609756E-8)
+--- testing: '1.2' / '123e5xyz' ---
+float(9.7560975609756E-8)
+--- testing: '1.2' / ' 123abc' ---
+float(0.0097560975609756)
+--- testing: '1.2' / '123 abc' ---
+float(0.0097560975609756)
+--- testing: '1.2' / '123abc ' ---
+float(0.0097560975609756)
+--- testing: '1.2' / '3.4a' ---
+float(0.35294117647059)
+--- testing: '1.2' / 'a5.9' ---
+bool(false)
+--- testing: '-7.7' / '0' ---
+bool(false)
+--- testing: '-7.7' / '65' ---
+float(-0.11846153846154)
+--- testing: '-7.7' / '-44' ---
+float(0.175)
+--- testing: '-7.7' / '1.2' ---
+float(-6.4166666666667)
+--- testing: '-7.7' / '-7.7' ---
+float(1)
+--- testing: '-7.7' / 'abc' ---
+bool(false)
+--- testing: '-7.7' / '123abc' ---
+float(-0.06260162601626)
+--- testing: '-7.7' / '123e5' ---
+float(-6.260162601626E-7)
+--- testing: '-7.7' / '123e5xyz' ---
+float(-6.260162601626E-7)
+--- testing: '-7.7' / ' 123abc' ---
+float(-0.06260162601626)
+--- testing: '-7.7' / '123 abc' ---
+float(-0.06260162601626)
+--- testing: '-7.7' / '123abc ' ---
+float(-0.06260162601626)
+--- testing: '-7.7' / '3.4a' ---
+float(-2.2647058823529)
+--- testing: '-7.7' / 'a5.9' ---
+bool(false)
+--- testing: 'abc' / '0' ---
+bool(false)
+--- testing: 'abc' / '65' ---
+int(0)
+--- testing: 'abc' / '-44' ---
+int(0)
+--- testing: 'abc' / '1.2' ---
+float(0)
+--- testing: 'abc' / '-7.7' ---
+float(-0)
+--- testing: 'abc' / 'abc' ---
+bool(false)
+--- testing: 'abc' / '123abc' ---
+int(0)
+--- testing: 'abc' / '123e5' ---
+float(0)
+--- testing: 'abc' / '123e5xyz' ---
+float(0)
+--- testing: 'abc' / ' 123abc' ---
+int(0)
+--- testing: 'abc' / '123 abc' ---
+int(0)
+--- testing: 'abc' / '123abc ' ---
+int(0)
+--- testing: 'abc' / '3.4a' ---
+float(0)
+--- testing: 'abc' / 'a5.9' ---
+bool(false)
+--- testing: '123abc' / '0' ---
+bool(false)
+--- testing: '123abc' / '65' ---
+float(1.8923076923077)
+--- testing: '123abc' / '-44' ---
+float(-2.7954545454545)
+--- testing: '123abc' / '1.2' ---
+float(102.5)
+--- testing: '123abc' / '-7.7' ---
+float(-15.974025974026)
+--- testing: '123abc' / 'abc' ---
+bool(false)
+--- testing: '123abc' / '123abc' ---
+int(1)
+--- testing: '123abc' / '123e5' ---
+float(1.0E-5)
+--- testing: '123abc' / '123e5xyz' ---
+float(1.0E-5)
+--- testing: '123abc' / ' 123abc' ---
+int(1)
+--- testing: '123abc' / '123 abc' ---
+int(1)
+--- testing: '123abc' / '123abc ' ---
+int(1)
+--- testing: '123abc' / '3.4a' ---
+float(36.176470588235)
+--- testing: '123abc' / 'a5.9' ---
+bool(false)
+--- testing: '123e5' / '0' ---
+bool(false)
+--- testing: '123e5' / '65' ---
+float(189230.76923077)
+--- testing: '123e5' / '-44' ---
+float(-279545.45454545)
+--- testing: '123e5' / '1.2' ---
+float(10250000)
+--- testing: '123e5' / '-7.7' ---
+float(-1597402.5974026)
+--- testing: '123e5' / 'abc' ---
+bool(false)
+--- testing: '123e5' / '123abc' ---
+float(100000)
+--- testing: '123e5' / '123e5' ---
+float(1)
+--- testing: '123e5' / '123e5xyz' ---
+float(1)
+--- testing: '123e5' / ' 123abc' ---
+float(100000)
+--- testing: '123e5' / '123 abc' ---
+float(100000)
+--- testing: '123e5' / '123abc ' ---
+float(100000)
+--- testing: '123e5' / '3.4a' ---
+float(3617647.0588235)
+--- testing: '123e5' / 'a5.9' ---
+bool(false)
+--- testing: '123e5xyz' / '0' ---
+bool(false)
+--- testing: '123e5xyz' / '65' ---
+float(189230.76923077)
+--- testing: '123e5xyz' / '-44' ---
+float(-279545.45454545)
+--- testing: '123e5xyz' / '1.2' ---
+float(10250000)
+--- testing: '123e5xyz' / '-7.7' ---
+float(-1597402.5974026)
+--- testing: '123e5xyz' / 'abc' ---
+bool(false)
+--- testing: '123e5xyz' / '123abc' ---
+float(100000)
+--- testing: '123e5xyz' / '123e5' ---
+float(1)
+--- testing: '123e5xyz' / '123e5xyz' ---
+float(1)
+--- testing: '123e5xyz' / ' 123abc' ---
+float(100000)
+--- testing: '123e5xyz' / '123 abc' ---
+float(100000)
+--- testing: '123e5xyz' / '123abc ' ---
+float(100000)
+--- testing: '123e5xyz' / '3.4a' ---
+float(3617647.0588235)
+--- testing: '123e5xyz' / 'a5.9' ---
+bool(false)
+--- testing: ' 123abc' / '0' ---
+bool(false)
+--- testing: ' 123abc' / '65' ---
+float(1.8923076923077)
+--- testing: ' 123abc' / '-44' ---
+float(-2.7954545454545)
+--- testing: ' 123abc' / '1.2' ---
+float(102.5)
+--- testing: ' 123abc' / '-7.7' ---
+float(-15.974025974026)
+--- testing: ' 123abc' / 'abc' ---
+bool(false)
+--- testing: ' 123abc' / '123abc' ---
+int(1)
+--- testing: ' 123abc' / '123e5' ---
+float(1.0E-5)
+--- testing: ' 123abc' / '123e5xyz' ---
+float(1.0E-5)
+--- testing: ' 123abc' / ' 123abc' ---
+int(1)
+--- testing: ' 123abc' / '123 abc' ---
+int(1)
+--- testing: ' 123abc' / '123abc ' ---
+int(1)
+--- testing: ' 123abc' / '3.4a' ---
+float(36.176470588235)
+--- testing: ' 123abc' / 'a5.9' ---
+bool(false)
+--- testing: '123 abc' / '0' ---
+bool(false)
+--- testing: '123 abc' / '65' ---
+float(1.8923076923077)
+--- testing: '123 abc' / '-44' ---
+float(-2.7954545454545)
+--- testing: '123 abc' / '1.2' ---
+float(102.5)
+--- testing: '123 abc' / '-7.7' ---
+float(-15.974025974026)
+--- testing: '123 abc' / 'abc' ---
+bool(false)
+--- testing: '123 abc' / '123abc' ---
+int(1)
+--- testing: '123 abc' / '123e5' ---
+float(1.0E-5)
+--- testing: '123 abc' / '123e5xyz' ---
+float(1.0E-5)
+--- testing: '123 abc' / ' 123abc' ---
+int(1)
+--- testing: '123 abc' / '123 abc' ---
+int(1)
+--- testing: '123 abc' / '123abc ' ---
+int(1)
+--- testing: '123 abc' / '3.4a' ---
+float(36.176470588235)
+--- testing: '123 abc' / 'a5.9' ---
+bool(false)
+--- testing: '123abc ' / '0' ---
+bool(false)
+--- testing: '123abc ' / '65' ---
+float(1.8923076923077)
+--- testing: '123abc ' / '-44' ---
+float(-2.7954545454545)
+--- testing: '123abc ' / '1.2' ---
+float(102.5)
+--- testing: '123abc ' / '-7.7' ---
+float(-15.974025974026)
+--- testing: '123abc ' / 'abc' ---
+bool(false)
+--- testing: '123abc ' / '123abc' ---
+int(1)
+--- testing: '123abc ' / '123e5' ---
+float(1.0E-5)
+--- testing: '123abc ' / '123e5xyz' ---
+float(1.0E-5)
+--- testing: '123abc ' / ' 123abc' ---
+int(1)
+--- testing: '123abc ' / '123 abc' ---
+int(1)
+--- testing: '123abc ' / '123abc ' ---
+int(1)
+--- testing: '123abc ' / '3.4a' ---
+float(36.176470588235)
+--- testing: '123abc ' / 'a5.9' ---
+bool(false)
+--- testing: '3.4a' / '0' ---
+bool(false)
+--- testing: '3.4a' / '65' ---
+float(0.052307692307692)
+--- testing: '3.4a' / '-44' ---
+float(-0.077272727272727)
+--- testing: '3.4a' / '1.2' ---
+float(2.8333333333333)
+--- testing: '3.4a' / '-7.7' ---
+float(-0.44155844155844)
+--- testing: '3.4a' / 'abc' ---
+bool(false)
+--- testing: '3.4a' / '123abc' ---
+float(0.027642276422764)
+--- testing: '3.4a' / '123e5' ---
+float(2.7642276422764E-7)
+--- testing: '3.4a' / '123e5xyz' ---
+float(2.7642276422764E-7)
+--- testing: '3.4a' / ' 123abc' ---
+float(0.027642276422764)
+--- testing: '3.4a' / '123 abc' ---
+float(0.027642276422764)
+--- testing: '3.4a' / '123abc ' ---
+float(0.027642276422764)
+--- testing: '3.4a' / '3.4a' ---
+float(1)
+--- testing: '3.4a' / 'a5.9' ---
+bool(false)
+--- testing: 'a5.9' / '0' ---
+bool(false)
+--- testing: 'a5.9' / '65' ---
+int(0)
+--- testing: 'a5.9' / '-44' ---
+int(0)
+--- testing: 'a5.9' / '1.2' ---
+float(0)
+--- testing: 'a5.9' / '-7.7' ---
+float(-0)
+--- testing: 'a5.9' / 'abc' ---
+bool(false)
+--- testing: 'a5.9' / '123abc' ---
+int(0)
+--- testing: 'a5.9' / '123e5' ---
+float(0)
+--- testing: 'a5.9' / '123e5xyz' ---
+float(0)
+--- testing: 'a5.9' / ' 123abc' ---
+int(0)
+--- testing: 'a5.9' / '123 abc' ---
+int(0)
+--- testing: 'a5.9' / '123abc ' ---
+int(0)
+--- testing: 'a5.9' / '3.4a' ---
+float(0)
+--- testing: 'a5.9' / 'a5.9' ---
+bool(false)
+===DONE===
diff --git a/tests/lang/operators/modulus_basiclong_64bit.phpt b/tests/lang/operators/modulus_basiclong_64bit.phpt
new file mode 100644
index 0000000..d75ff1e
--- /dev/null
+++ b/tests/lang/operators/modulus_basiclong_64bit.phpt
@@ -0,0 +1,582 @@
+--TEST--
+Test % operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal % $otherVal ---\n";
+ var_dump($longVal%$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal % $longVal ---\n";
+ var_dump($otherVal%$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 % 0 ---
+bool(false)
+--- testing: 9223372036854775807 % 1 ---
+int(0)
+--- testing: 9223372036854775807 % -1 ---
+int(0)
+--- testing: 9223372036854775807 % 7 ---
+int(0)
+--- testing: 9223372036854775807 % 9 ---
+int(7)
+--- testing: 9223372036854775807 % 65 ---
+int(7)
+--- testing: 9223372036854775807 % -44 ---
+int(7)
+--- testing: 9223372036854775807 % 2147483647 ---
+int(1)
+--- testing: 9223372036854775807 % 9223372036854775807 ---
+int(0)
+--- testing: -9223372036854775808 % 0 ---
+bool(false)
+--- testing: -9223372036854775808 % 1 ---
+int(0)
+--- testing: -9223372036854775808 % -1 ---
+int(0)
+--- testing: -9223372036854775808 % 7 ---
+int(-1)
+--- testing: -9223372036854775808 % 9 ---
+int(-8)
+--- testing: -9223372036854775808 % 65 ---
+int(-8)
+--- testing: -9223372036854775808 % -44 ---
+int(-8)
+--- testing: -9223372036854775808 % 2147483647 ---
+int(-2)
+--- testing: -9223372036854775808 % 9223372036854775807 ---
+int(-1)
+--- testing: 2147483647 % 0 ---
+bool(false)
+--- testing: 2147483647 % 1 ---
+int(0)
+--- testing: 2147483647 % -1 ---
+int(0)
+--- testing: 2147483647 % 7 ---
+int(1)
+--- testing: 2147483647 % 9 ---
+int(1)
+--- testing: 2147483647 % 65 ---
+int(62)
+--- testing: 2147483647 % -44 ---
+int(23)
+--- testing: 2147483647 % 2147483647 ---
+int(0)
+--- testing: 2147483647 % 9223372036854775807 ---
+int(2147483647)
+--- testing: -2147483648 % 0 ---
+bool(false)
+--- testing: -2147483648 % 1 ---
+int(0)
+--- testing: -2147483648 % -1 ---
+int(0)
+--- testing: -2147483648 % 7 ---
+int(-2)
+--- testing: -2147483648 % 9 ---
+int(-2)
+--- testing: -2147483648 % 65 ---
+int(-63)
+--- testing: -2147483648 % -44 ---
+int(-24)
+--- testing: -2147483648 % 2147483647 ---
+int(-1)
+--- testing: -2147483648 % 9223372036854775807 ---
+int(-2147483648)
+--- testing: 9223372034707292160 % 0 ---
+bool(false)
+--- testing: 9223372034707292160 % 1 ---
+int(0)
+--- testing: 9223372034707292160 % -1 ---
+int(0)
+--- testing: 9223372034707292160 % 7 ---
+int(6)
+--- testing: 9223372034707292160 % 9 ---
+int(6)
+--- testing: 9223372034707292160 % 65 ---
+int(10)
+--- testing: 9223372034707292160 % -44 ---
+int(28)
+--- testing: 9223372034707292160 % 2147483647 ---
+int(1)
+--- testing: 9223372034707292160 % 9223372036854775807 ---
+int(9223372034707292160)
+--- testing: -9223372034707292160 % 0 ---
+bool(false)
+--- testing: -9223372034707292160 % 1 ---
+int(0)
+--- testing: -9223372034707292160 % -1 ---
+int(0)
+--- testing: -9223372034707292160 % 7 ---
+int(-6)
+--- testing: -9223372034707292160 % 9 ---
+int(-6)
+--- testing: -9223372034707292160 % 65 ---
+int(-10)
+--- testing: -9223372034707292160 % -44 ---
+int(-28)
+--- testing: -9223372034707292160 % 2147483647 ---
+int(-1)
+--- testing: -9223372034707292160 % 9223372036854775807 ---
+int(-9223372034707292160)
+--- testing: 2147483648 % 0 ---
+bool(false)
+--- testing: 2147483648 % 1 ---
+int(0)
+--- testing: 2147483648 % -1 ---
+int(0)
+--- testing: 2147483648 % 7 ---
+int(2)
+--- testing: 2147483648 % 9 ---
+int(2)
+--- testing: 2147483648 % 65 ---
+int(63)
+--- testing: 2147483648 % -44 ---
+int(24)
+--- testing: 2147483648 % 2147483647 ---
+int(1)
+--- testing: 2147483648 % 9223372036854775807 ---
+int(2147483648)
+--- testing: -2147483649 % 0 ---
+bool(false)
+--- testing: -2147483649 % 1 ---
+int(0)
+--- testing: -2147483649 % -1 ---
+int(0)
+--- testing: -2147483649 % 7 ---
+int(-3)
+--- testing: -2147483649 % 9 ---
+int(-3)
+--- testing: -2147483649 % 65 ---
+int(-64)
+--- testing: -2147483649 % -44 ---
+int(-25)
+--- testing: -2147483649 % 2147483647 ---
+int(-2)
+--- testing: -2147483649 % 9223372036854775807 ---
+int(-2147483649)
+--- testing: 4294967294 % 0 ---
+bool(false)
+--- testing: 4294967294 % 1 ---
+int(0)
+--- testing: 4294967294 % -1 ---
+int(0)
+--- testing: 4294967294 % 7 ---
+int(2)
+--- testing: 4294967294 % 9 ---
+int(2)
+--- testing: 4294967294 % 65 ---
+int(59)
+--- testing: 4294967294 % -44 ---
+int(2)
+--- testing: 4294967294 % 2147483647 ---
+int(0)
+--- testing: 4294967294 % 9223372036854775807 ---
+int(4294967294)
+--- testing: 4294967295 % 0 ---
+bool(false)
+--- testing: 4294967295 % 1 ---
+int(0)
+--- testing: 4294967295 % -1 ---
+int(0)
+--- testing: 4294967295 % 7 ---
+int(3)
+--- testing: 4294967295 % 9 ---
+int(3)
+--- testing: 4294967295 % 65 ---
+int(60)
+--- testing: 4294967295 % -44 ---
+int(3)
+--- testing: 4294967295 % 2147483647 ---
+int(1)
+--- testing: 4294967295 % 9223372036854775807 ---
+int(4294967295)
+--- testing: 4294967293 % 0 ---
+bool(false)
+--- testing: 4294967293 % 1 ---
+int(0)
+--- testing: 4294967293 % -1 ---
+int(0)
+--- testing: 4294967293 % 7 ---
+int(1)
+--- testing: 4294967293 % 9 ---
+int(1)
+--- testing: 4294967293 % 65 ---
+int(58)
+--- testing: 4294967293 % -44 ---
+int(1)
+--- testing: 4294967293 % 2147483647 ---
+int(2147483646)
+--- testing: 4294967293 % 9223372036854775807 ---
+int(4294967293)
+--- testing: 9223372036854775806 % 0 ---
+bool(false)
+--- testing: 9223372036854775806 % 1 ---
+int(0)
+--- testing: 9223372036854775806 % -1 ---
+int(0)
+--- testing: 9223372036854775806 % 7 ---
+int(6)
+--- testing: 9223372036854775806 % 9 ---
+int(6)
+--- testing: 9223372036854775806 % 65 ---
+int(6)
+--- testing: 9223372036854775806 % -44 ---
+int(6)
+--- testing: 9223372036854775806 % 2147483647 ---
+int(0)
+--- testing: 9223372036854775806 % 9223372036854775807 ---
+int(9223372036854775806)
+--- testing: 9.2233720368548E+18 % 0 ---
+bool(false)
+--- testing: 9.2233720368548E+18 % 1 ---
+int(0)
+--- testing: 9.2233720368548E+18 % -1 ---
+int(0)
+--- testing: 9.2233720368548E+18 % 7 ---
+int(-1)
+--- testing: 9.2233720368548E+18 % 9 ---
+int(-8)
+--- testing: 9.2233720368548E+18 % 65 ---
+int(-8)
+--- testing: 9.2233720368548E+18 % -44 ---
+int(-8)
+--- testing: 9.2233720368548E+18 % 2147483647 ---
+int(-2)
+--- testing: 9.2233720368548E+18 % 9223372036854775807 ---
+int(-1)
+--- testing: -9223372036854775807 % 0 ---
+bool(false)
+--- testing: -9223372036854775807 % 1 ---
+int(0)
+--- testing: -9223372036854775807 % -1 ---
+int(0)
+--- testing: -9223372036854775807 % 7 ---
+int(0)
+--- testing: -9223372036854775807 % 9 ---
+int(-7)
+--- testing: -9223372036854775807 % 65 ---
+int(-7)
+--- testing: -9223372036854775807 % -44 ---
+int(-7)
+--- testing: -9223372036854775807 % 2147483647 ---
+int(-1)
+--- testing: -9223372036854775807 % 9223372036854775807 ---
+int(0)
+--- testing: -9.2233720368548E+18 % 0 ---
+bool(false)
+--- testing: -9.2233720368548E+18 % 1 ---
+int(0)
+--- testing: -9.2233720368548E+18 % -1 ---
+int(0)
+--- testing: -9.2233720368548E+18 % 7 ---
+int(-1)
+--- testing: -9.2233720368548E+18 % 9 ---
+int(-8)
+--- testing: -9.2233720368548E+18 % 65 ---
+int(-8)
+--- testing: -9.2233720368548E+18 % -44 ---
+int(-8)
+--- testing: -9.2233720368548E+18 % 2147483647 ---
+int(-2)
+--- testing: -9.2233720368548E+18 % 9223372036854775807 ---
+int(-1)
+--- testing: 0 % 9223372036854775807 ---
+int(0)
+--- testing: 0 % -9223372036854775808 ---
+int(0)
+--- testing: 0 % 2147483647 ---
+int(0)
+--- testing: 0 % -2147483648 ---
+int(0)
+--- testing: 0 % 9223372034707292160 ---
+int(0)
+--- testing: 0 % -9223372034707292160 ---
+int(0)
+--- testing: 0 % 2147483648 ---
+int(0)
+--- testing: 0 % -2147483649 ---
+int(0)
+--- testing: 0 % 4294967294 ---
+int(0)
+--- testing: 0 % 4294967295 ---
+int(0)
+--- testing: 0 % 4294967293 ---
+int(0)
+--- testing: 0 % 9223372036854775806 ---
+int(0)
+--- testing: 0 % 9.2233720368548E+18 ---
+int(0)
+--- testing: 0 % -9223372036854775807 ---
+int(0)
+--- testing: 0 % -9.2233720368548E+18 ---
+int(0)
+--- testing: 1 % 9223372036854775807 ---
+int(1)
+--- testing: 1 % -9223372036854775808 ---
+int(1)
+--- testing: 1 % 2147483647 ---
+int(1)
+--- testing: 1 % -2147483648 ---
+int(1)
+--- testing: 1 % 9223372034707292160 ---
+int(1)
+--- testing: 1 % -9223372034707292160 ---
+int(1)
+--- testing: 1 % 2147483648 ---
+int(1)
+--- testing: 1 % -2147483649 ---
+int(1)
+--- testing: 1 % 4294967294 ---
+int(1)
+--- testing: 1 % 4294967295 ---
+int(1)
+--- testing: 1 % 4294967293 ---
+int(1)
+--- testing: 1 % 9223372036854775806 ---
+int(1)
+--- testing: 1 % 9.2233720368548E+18 ---
+int(1)
+--- testing: 1 % -9223372036854775807 ---
+int(1)
+--- testing: 1 % -9.2233720368548E+18 ---
+int(1)
+--- testing: -1 % 9223372036854775807 ---
+int(-1)
+--- testing: -1 % -9223372036854775808 ---
+int(-1)
+--- testing: -1 % 2147483647 ---
+int(-1)
+--- testing: -1 % -2147483648 ---
+int(-1)
+--- testing: -1 % 9223372034707292160 ---
+int(-1)
+--- testing: -1 % -9223372034707292160 ---
+int(-1)
+--- testing: -1 % 2147483648 ---
+int(-1)
+--- testing: -1 % -2147483649 ---
+int(-1)
+--- testing: -1 % 4294967294 ---
+int(-1)
+--- testing: -1 % 4294967295 ---
+int(-1)
+--- testing: -1 % 4294967293 ---
+int(-1)
+--- testing: -1 % 9223372036854775806 ---
+int(-1)
+--- testing: -1 % 9.2233720368548E+18 ---
+int(-1)
+--- testing: -1 % -9223372036854775807 ---
+int(-1)
+--- testing: -1 % -9.2233720368548E+18 ---
+int(-1)
+--- testing: 7 % 9223372036854775807 ---
+int(7)
+--- testing: 7 % -9223372036854775808 ---
+int(7)
+--- testing: 7 % 2147483647 ---
+int(7)
+--- testing: 7 % -2147483648 ---
+int(7)
+--- testing: 7 % 9223372034707292160 ---
+int(7)
+--- testing: 7 % -9223372034707292160 ---
+int(7)
+--- testing: 7 % 2147483648 ---
+int(7)
+--- testing: 7 % -2147483649 ---
+int(7)
+--- testing: 7 % 4294967294 ---
+int(7)
+--- testing: 7 % 4294967295 ---
+int(7)
+--- testing: 7 % 4294967293 ---
+int(7)
+--- testing: 7 % 9223372036854775806 ---
+int(7)
+--- testing: 7 % 9.2233720368548E+18 ---
+int(7)
+--- testing: 7 % -9223372036854775807 ---
+int(7)
+--- testing: 7 % -9.2233720368548E+18 ---
+int(7)
+--- testing: 9 % 9223372036854775807 ---
+int(9)
+--- testing: 9 % -9223372036854775808 ---
+int(9)
+--- testing: 9 % 2147483647 ---
+int(9)
+--- testing: 9 % -2147483648 ---
+int(9)
+--- testing: 9 % 9223372034707292160 ---
+int(9)
+--- testing: 9 % -9223372034707292160 ---
+int(9)
+--- testing: 9 % 2147483648 ---
+int(9)
+--- testing: 9 % -2147483649 ---
+int(9)
+--- testing: 9 % 4294967294 ---
+int(9)
+--- testing: 9 % 4294967295 ---
+int(9)
+--- testing: 9 % 4294967293 ---
+int(9)
+--- testing: 9 % 9223372036854775806 ---
+int(9)
+--- testing: 9 % 9.2233720368548E+18 ---
+int(9)
+--- testing: 9 % -9223372036854775807 ---
+int(9)
+--- testing: 9 % -9.2233720368548E+18 ---
+int(9)
+--- testing: 65 % 9223372036854775807 ---
+int(65)
+--- testing: 65 % -9223372036854775808 ---
+int(65)
+--- testing: 65 % 2147483647 ---
+int(65)
+--- testing: 65 % -2147483648 ---
+int(65)
+--- testing: 65 % 9223372034707292160 ---
+int(65)
+--- testing: 65 % -9223372034707292160 ---
+int(65)
+--- testing: 65 % 2147483648 ---
+int(65)
+--- testing: 65 % -2147483649 ---
+int(65)
+--- testing: 65 % 4294967294 ---
+int(65)
+--- testing: 65 % 4294967295 ---
+int(65)
+--- testing: 65 % 4294967293 ---
+int(65)
+--- testing: 65 % 9223372036854775806 ---
+int(65)
+--- testing: 65 % 9.2233720368548E+18 ---
+int(65)
+--- testing: 65 % -9223372036854775807 ---
+int(65)
+--- testing: 65 % -9.2233720368548E+18 ---
+int(65)
+--- testing: -44 % 9223372036854775807 ---
+int(-44)
+--- testing: -44 % -9223372036854775808 ---
+int(-44)
+--- testing: -44 % 2147483647 ---
+int(-44)
+--- testing: -44 % -2147483648 ---
+int(-44)
+--- testing: -44 % 9223372034707292160 ---
+int(-44)
+--- testing: -44 % -9223372034707292160 ---
+int(-44)
+--- testing: -44 % 2147483648 ---
+int(-44)
+--- testing: -44 % -2147483649 ---
+int(-44)
+--- testing: -44 % 4294967294 ---
+int(-44)
+--- testing: -44 % 4294967295 ---
+int(-44)
+--- testing: -44 % 4294967293 ---
+int(-44)
+--- testing: -44 % 9223372036854775806 ---
+int(-44)
+--- testing: -44 % 9.2233720368548E+18 ---
+int(-44)
+--- testing: -44 % -9223372036854775807 ---
+int(-44)
+--- testing: -44 % -9.2233720368548E+18 ---
+int(-44)
+--- testing: 2147483647 % 9223372036854775807 ---
+int(2147483647)
+--- testing: 2147483647 % -9223372036854775808 ---
+int(2147483647)
+--- testing: 2147483647 % 2147483647 ---
+int(0)
+--- testing: 2147483647 % -2147483648 ---
+int(2147483647)
+--- testing: 2147483647 % 9223372034707292160 ---
+int(2147483647)
+--- testing: 2147483647 % -9223372034707292160 ---
+int(2147483647)
+--- testing: 2147483647 % 2147483648 ---
+int(2147483647)
+--- testing: 2147483647 % -2147483649 ---
+int(2147483647)
+--- testing: 2147483647 % 4294967294 ---
+int(2147483647)
+--- testing: 2147483647 % 4294967295 ---
+int(2147483647)
+--- testing: 2147483647 % 4294967293 ---
+int(2147483647)
+--- testing: 2147483647 % 9223372036854775806 ---
+int(2147483647)
+--- testing: 2147483647 % 9.2233720368548E+18 ---
+int(2147483647)
+--- testing: 2147483647 % -9223372036854775807 ---
+int(2147483647)
+--- testing: 2147483647 % -9.2233720368548E+18 ---
+int(2147483647)
+--- testing: 9223372036854775807 % 9223372036854775807 ---
+int(0)
+--- testing: 9223372036854775807 % -9223372036854775808 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 % 2147483647 ---
+int(1)
+--- testing: 9223372036854775807 % -2147483648 ---
+int(2147483647)
+--- testing: 9223372036854775807 % 9223372034707292160 ---
+int(2147483647)
+--- testing: 9223372036854775807 % -9223372034707292160 ---
+int(2147483647)
+--- testing: 9223372036854775807 % 2147483648 ---
+int(2147483647)
+--- testing: 9223372036854775807 % -2147483649 ---
+int(1)
+--- testing: 9223372036854775807 % 4294967294 ---
+int(1)
+--- testing: 9223372036854775807 % 4294967295 ---
+int(2147483647)
+--- testing: 9223372036854775807 % 4294967293 ---
+int(2147483650)
+--- testing: 9223372036854775807 % 9223372036854775806 ---
+int(1)
+--- testing: 9223372036854775807 % 9.2233720368548E+18 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 % -9223372036854775807 ---
+int(0)
+--- testing: 9223372036854775807 % -9.2233720368548E+18 ---
+int(9223372036854775807)
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt
new file mode 100644
index 0000000..7b3ce76
--- /dev/null
+++ b/tests/lang/operators/modulus_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test % operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' % '$otherVal' ---\n";
+ var_dump($strVal%$otherVal);
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' % '0' ---
+bool(false)
+--- testing: '0' % '65' ---
+int(0)
+--- testing: '0' % '-44' ---
+int(0)
+--- testing: '0' % '1.2' ---
+int(0)
+--- testing: '0' % '-7.7' ---
+int(0)
+--- testing: '0' % 'abc' ---
+bool(false)
+--- testing: '0' % '123abc' ---
+int(0)
+--- testing: '0' % '123e5' ---
+int(0)
+--- testing: '0' % '123e5xyz' ---
+int(0)
+--- testing: '0' % ' 123abc' ---
+int(0)
+--- testing: '0' % '123 abc' ---
+int(0)
+--- testing: '0' % '123abc ' ---
+int(0)
+--- testing: '0' % '3.4a' ---
+int(0)
+--- testing: '0' % 'a5.9' ---
+bool(false)
+--- testing: '65' % '0' ---
+bool(false)
+--- testing: '65' % '65' ---
+int(0)
+--- testing: '65' % '-44' ---
+int(21)
+--- testing: '65' % '1.2' ---
+int(0)
+--- testing: '65' % '-7.7' ---
+int(2)
+--- testing: '65' % 'abc' ---
+bool(false)
+--- testing: '65' % '123abc' ---
+int(65)
+--- testing: '65' % '123e5' ---
+int(65)
+--- testing: '65' % '123e5xyz' ---
+int(65)
+--- testing: '65' % ' 123abc' ---
+int(65)
+--- testing: '65' % '123 abc' ---
+int(65)
+--- testing: '65' % '123abc ' ---
+int(65)
+--- testing: '65' % '3.4a' ---
+int(2)
+--- testing: '65' % 'a5.9' ---
+bool(false)
+--- testing: '-44' % '0' ---
+bool(false)
+--- testing: '-44' % '65' ---
+int(-44)
+--- testing: '-44' % '-44' ---
+int(0)
+--- testing: '-44' % '1.2' ---
+int(0)
+--- testing: '-44' % '-7.7' ---
+int(-2)
+--- testing: '-44' % 'abc' ---
+bool(false)
+--- testing: '-44' % '123abc' ---
+int(-44)
+--- testing: '-44' % '123e5' ---
+int(-44)
+--- testing: '-44' % '123e5xyz' ---
+int(-44)
+--- testing: '-44' % ' 123abc' ---
+int(-44)
+--- testing: '-44' % '123 abc' ---
+int(-44)
+--- testing: '-44' % '123abc ' ---
+int(-44)
+--- testing: '-44' % '3.4a' ---
+int(-2)
+--- testing: '-44' % 'a5.9' ---
+bool(false)
+--- testing: '1.2' % '0' ---
+bool(false)
+--- testing: '1.2' % '65' ---
+int(1)
+--- testing: '1.2' % '-44' ---
+int(1)
+--- testing: '1.2' % '1.2' ---
+int(0)
+--- testing: '1.2' % '-7.7' ---
+int(1)
+--- testing: '1.2' % 'abc' ---
+bool(false)
+--- testing: '1.2' % '123abc' ---
+int(1)
+--- testing: '1.2' % '123e5' ---
+int(1)
+--- testing: '1.2' % '123e5xyz' ---
+int(1)
+--- testing: '1.2' % ' 123abc' ---
+int(1)
+--- testing: '1.2' % '123 abc' ---
+int(1)
+--- testing: '1.2' % '123abc ' ---
+int(1)
+--- testing: '1.2' % '3.4a' ---
+int(1)
+--- testing: '1.2' % 'a5.9' ---
+bool(false)
+--- testing: '-7.7' % '0' ---
+bool(false)
+--- testing: '-7.7' % '65' ---
+int(-7)
+--- testing: '-7.7' % '-44' ---
+int(-7)
+--- testing: '-7.7' % '1.2' ---
+int(0)
+--- testing: '-7.7' % '-7.7' ---
+int(0)
+--- testing: '-7.7' % 'abc' ---
+bool(false)
+--- testing: '-7.7' % '123abc' ---
+int(-7)
+--- testing: '-7.7' % '123e5' ---
+int(-7)
+--- testing: '-7.7' % '123e5xyz' ---
+int(-7)
+--- testing: '-7.7' % ' 123abc' ---
+int(-7)
+--- testing: '-7.7' % '123 abc' ---
+int(-7)
+--- testing: '-7.7' % '123abc ' ---
+int(-7)
+--- testing: '-7.7' % '3.4a' ---
+int(-1)
+--- testing: '-7.7' % 'a5.9' ---
+bool(false)
+--- testing: 'abc' % '0' ---
+bool(false)
+--- testing: 'abc' % '65' ---
+int(0)
+--- testing: 'abc' % '-44' ---
+int(0)
+--- testing: 'abc' % '1.2' ---
+int(0)
+--- testing: 'abc' % '-7.7' ---
+int(0)
+--- testing: 'abc' % 'abc' ---
+bool(false)
+--- testing: 'abc' % '123abc' ---
+int(0)
+--- testing: 'abc' % '123e5' ---
+int(0)
+--- testing: 'abc' % '123e5xyz' ---
+int(0)
+--- testing: 'abc' % ' 123abc' ---
+int(0)
+--- testing: 'abc' % '123 abc' ---
+int(0)
+--- testing: 'abc' % '123abc ' ---
+int(0)
+--- testing: 'abc' % '3.4a' ---
+int(0)
+--- testing: 'abc' % 'a5.9' ---
+bool(false)
+--- testing: '123abc' % '0' ---
+bool(false)
+--- testing: '123abc' % '65' ---
+int(58)
+--- testing: '123abc' % '-44' ---
+int(35)
+--- testing: '123abc' % '1.2' ---
+int(0)
+--- testing: '123abc' % '-7.7' ---
+int(4)
+--- testing: '123abc' % 'abc' ---
+bool(false)
+--- testing: '123abc' % '123abc' ---
+int(0)
+--- testing: '123abc' % '123e5' ---
+int(0)
+--- testing: '123abc' % '123e5xyz' ---
+int(0)
+--- testing: '123abc' % ' 123abc' ---
+int(0)
+--- testing: '123abc' % '123 abc' ---
+int(0)
+--- testing: '123abc' % '123abc ' ---
+int(0)
+--- testing: '123abc' % '3.4a' ---
+int(0)
+--- testing: '123abc' % 'a5.9' ---
+bool(false)
+--- testing: '123e5' % '0' ---
+bool(false)
+--- testing: '123e5' % '65' ---
+int(58)
+--- testing: '123e5' % '-44' ---
+int(35)
+--- testing: '123e5' % '1.2' ---
+int(0)
+--- testing: '123e5' % '-7.7' ---
+int(4)
+--- testing: '123e5' % 'abc' ---
+bool(false)
+--- testing: '123e5' % '123abc' ---
+int(0)
+--- testing: '123e5' % '123e5' ---
+int(0)
+--- testing: '123e5' % '123e5xyz' ---
+int(0)
+--- testing: '123e5' % ' 123abc' ---
+int(0)
+--- testing: '123e5' % '123 abc' ---
+int(0)
+--- testing: '123e5' % '123abc ' ---
+int(0)
+--- testing: '123e5' % '3.4a' ---
+int(0)
+--- testing: '123e5' % 'a5.9' ---
+bool(false)
+--- testing: '123e5xyz' % '0' ---
+bool(false)
+--- testing: '123e5xyz' % '65' ---
+int(58)
+--- testing: '123e5xyz' % '-44' ---
+int(35)
+--- testing: '123e5xyz' % '1.2' ---
+int(0)
+--- testing: '123e5xyz' % '-7.7' ---
+int(4)
+--- testing: '123e5xyz' % 'abc' ---
+bool(false)
+--- testing: '123e5xyz' % '123abc' ---
+int(0)
+--- testing: '123e5xyz' % '123e5' ---
+int(0)
+--- testing: '123e5xyz' % '123e5xyz' ---
+int(0)
+--- testing: '123e5xyz' % ' 123abc' ---
+int(0)
+--- testing: '123e5xyz' % '123 abc' ---
+int(0)
+--- testing: '123e5xyz' % '123abc ' ---
+int(0)
+--- testing: '123e5xyz' % '3.4a' ---
+int(0)
+--- testing: '123e5xyz' % 'a5.9' ---
+bool(false)
+--- testing: ' 123abc' % '0' ---
+bool(false)
+--- testing: ' 123abc' % '65' ---
+int(58)
+--- testing: ' 123abc' % '-44' ---
+int(35)
+--- testing: ' 123abc' % '1.2' ---
+int(0)
+--- testing: ' 123abc' % '-7.7' ---
+int(4)
+--- testing: ' 123abc' % 'abc' ---
+bool(false)
+--- testing: ' 123abc' % '123abc' ---
+int(0)
+--- testing: ' 123abc' % '123e5' ---
+int(0)
+--- testing: ' 123abc' % '123e5xyz' ---
+int(0)
+--- testing: ' 123abc' % ' 123abc' ---
+int(0)
+--- testing: ' 123abc' % '123 abc' ---
+int(0)
+--- testing: ' 123abc' % '123abc ' ---
+int(0)
+--- testing: ' 123abc' % '3.4a' ---
+int(0)
+--- testing: ' 123abc' % 'a5.9' ---
+bool(false)
+--- testing: '123 abc' % '0' ---
+bool(false)
+--- testing: '123 abc' % '65' ---
+int(58)
+--- testing: '123 abc' % '-44' ---
+int(35)
+--- testing: '123 abc' % '1.2' ---
+int(0)
+--- testing: '123 abc' % '-7.7' ---
+int(4)
+--- testing: '123 abc' % 'abc' ---
+bool(false)
+--- testing: '123 abc' % '123abc' ---
+int(0)
+--- testing: '123 abc' % '123e5' ---
+int(0)
+--- testing: '123 abc' % '123e5xyz' ---
+int(0)
+--- testing: '123 abc' % ' 123abc' ---
+int(0)
+--- testing: '123 abc' % '123 abc' ---
+int(0)
+--- testing: '123 abc' % '123abc ' ---
+int(0)
+--- testing: '123 abc' % '3.4a' ---
+int(0)
+--- testing: '123 abc' % 'a5.9' ---
+bool(false)
+--- testing: '123abc ' % '0' ---
+bool(false)
+--- testing: '123abc ' % '65' ---
+int(58)
+--- testing: '123abc ' % '-44' ---
+int(35)
+--- testing: '123abc ' % '1.2' ---
+int(0)
+--- testing: '123abc ' % '-7.7' ---
+int(4)
+--- testing: '123abc ' % 'abc' ---
+bool(false)
+--- testing: '123abc ' % '123abc' ---
+int(0)
+--- testing: '123abc ' % '123e5' ---
+int(0)
+--- testing: '123abc ' % '123e5xyz' ---
+int(0)
+--- testing: '123abc ' % ' 123abc' ---
+int(0)
+--- testing: '123abc ' % '123 abc' ---
+int(0)
+--- testing: '123abc ' % '123abc ' ---
+int(0)
+--- testing: '123abc ' % '3.4a' ---
+int(0)
+--- testing: '123abc ' % 'a5.9' ---
+bool(false)
+--- testing: '3.4a' % '0' ---
+bool(false)
+--- testing: '3.4a' % '65' ---
+int(3)
+--- testing: '3.4a' % '-44' ---
+int(3)
+--- testing: '3.4a' % '1.2' ---
+int(0)
+--- testing: '3.4a' % '-7.7' ---
+int(3)
+--- testing: '3.4a' % 'abc' ---
+bool(false)
+--- testing: '3.4a' % '123abc' ---
+int(3)
+--- testing: '3.4a' % '123e5' ---
+int(3)
+--- testing: '3.4a' % '123e5xyz' ---
+int(3)
+--- testing: '3.4a' % ' 123abc' ---
+int(3)
+--- testing: '3.4a' % '123 abc' ---
+int(3)
+--- testing: '3.4a' % '123abc ' ---
+int(3)
+--- testing: '3.4a' % '3.4a' ---
+int(0)
+--- testing: '3.4a' % 'a5.9' ---
+bool(false)
+--- testing: 'a5.9' % '0' ---
+bool(false)
+--- testing: 'a5.9' % '65' ---
+int(0)
+--- testing: 'a5.9' % '-44' ---
+int(0)
+--- testing: 'a5.9' % '1.2' ---
+int(0)
+--- testing: 'a5.9' % '-7.7' ---
+int(0)
+--- testing: 'a5.9' % 'abc' ---
+bool(false)
+--- testing: 'a5.9' % '123abc' ---
+int(0)
+--- testing: 'a5.9' % '123e5' ---
+int(0)
+--- testing: 'a5.9' % '123e5xyz' ---
+int(0)
+--- testing: 'a5.9' % ' 123abc' ---
+int(0)
+--- testing: 'a5.9' % '123 abc' ---
+int(0)
+--- testing: 'a5.9' % '123abc ' ---
+int(0)
+--- testing: 'a5.9' % '3.4a' ---
+int(0)
+--- testing: 'a5.9' % 'a5.9' ---
+bool(false)
+===DONE===
diff --git a/tests/lang/operators/multiply_basiclong_64bit.phpt b/tests/lang/operators/multiply_basiclong_64bit.phpt
new file mode 100644
index 0000000..4c7077b
--- /dev/null
+++ b/tests/lang/operators/multiply_basiclong_64bit.phpt
@@ -0,0 +1,582 @@
+--TEST--
+Test * operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal * $otherVal ---\n";
+ var_dump($longVal*$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal * $longVal ---\n";
+ var_dump($otherVal*$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 * 0 ---
+int(0)
+--- testing: 9223372036854775807 * 1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 * -1 ---
+int(-9223372036854775807)
+--- testing: 9223372036854775807 * 7 ---
+float(6.4563604257983E+19)
+--- testing: 9223372036854775807 * 9 ---
+float(8.3010348331693E+19)
+--- testing: 9223372036854775807 * 65 ---
+float(5.9951918239556E+20)
+--- testing: 9223372036854775807 * -44 ---
+float(-4.0582836962161E+20)
+--- testing: 9223372036854775807 * 2147483647 ---
+float(1.9807040619343E+28)
+--- testing: 9223372036854775807 * 9223372036854775807 ---
+float(8.5070591730235E+37)
+--- testing: -9223372036854775808 * 0 ---
+int(0)
+--- testing: -9223372036854775808 * 1 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 * -1 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775808 * 7 ---
+float(-6.4563604257983E+19)
+--- testing: -9223372036854775808 * 9 ---
+float(-8.3010348331693E+19)
+--- testing: -9223372036854775808 * 65 ---
+float(-5.9951918239556E+20)
+--- testing: -9223372036854775808 * -44 ---
+float(4.0582836962161E+20)
+--- testing: -9223372036854775808 * 2147483647 ---
+float(-1.9807040619343E+28)
+--- testing: -9223372036854775808 * 9223372036854775807 ---
+float(-8.5070591730235E+37)
+--- testing: 2147483647 * 0 ---
+int(0)
+--- testing: 2147483647 * 1 ---
+int(2147483647)
+--- testing: 2147483647 * -1 ---
+int(-2147483647)
+--- testing: 2147483647 * 7 ---
+int(15032385529)
+--- testing: 2147483647 * 9 ---
+int(19327352823)
+--- testing: 2147483647 * 65 ---
+int(139586437055)
+--- testing: 2147483647 * -44 ---
+int(-94489280468)
+--- testing: 2147483647 * 2147483647 ---
+int(4611686014132420609)
+--- testing: 2147483647 * 9223372036854775807 ---
+float(1.9807040619343E+28)
+--- testing: -2147483648 * 0 ---
+int(0)
+--- testing: -2147483648 * 1 ---
+int(-2147483648)
+--- testing: -2147483648 * -1 ---
+int(2147483648)
+--- testing: -2147483648 * 7 ---
+int(-15032385536)
+--- testing: -2147483648 * 9 ---
+int(-19327352832)
+--- testing: -2147483648 * 65 ---
+int(-139586437120)
+--- testing: -2147483648 * -44 ---
+int(94489280512)
+--- testing: -2147483648 * 2147483647 ---
+int(-4611686016279904256)
+--- testing: -2147483648 * 9223372036854775807 ---
+float(-1.9807040628566E+28)
+--- testing: 9223372034707292160 * 0 ---
+int(0)
+--- testing: 9223372034707292160 * 1 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 * -1 ---
+int(-9223372034707292160)
+--- testing: 9223372034707292160 * 7 ---
+float(6.4563604242951E+19)
+--- testing: 9223372034707292160 * 9 ---
+float(8.3010348312366E+19)
+--- testing: 9223372034707292160 * 65 ---
+float(5.9951918225597E+20)
+--- testing: 9223372034707292160 * -44 ---
+float(-4.0582836952712E+20)
+--- testing: 9223372034707292160 * 2147483647 ---
+float(1.9807040614731E+28)
+--- testing: 9223372034707292160 * 9223372036854775807 ---
+float(8.5070591710428E+37)
+--- testing: -9223372034707292160 * 0 ---
+int(0)
+--- testing: -9223372034707292160 * 1 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 * -1 ---
+int(9223372034707292160)
+--- testing: -9223372034707292160 * 7 ---
+float(-6.4563604242951E+19)
+--- testing: -9223372034707292160 * 9 ---
+float(-8.3010348312366E+19)
+--- testing: -9223372034707292160 * 65 ---
+float(-5.9951918225597E+20)
+--- testing: -9223372034707292160 * -44 ---
+float(4.0582836952712E+20)
+--- testing: -9223372034707292160 * 2147483647 ---
+float(-1.9807040614731E+28)
+--- testing: -9223372034707292160 * 9223372036854775807 ---
+float(-8.5070591710428E+37)
+--- testing: 2147483648 * 0 ---
+int(0)
+--- testing: 2147483648 * 1 ---
+int(2147483648)
+--- testing: 2147483648 * -1 ---
+int(-2147483648)
+--- testing: 2147483648 * 7 ---
+int(15032385536)
+--- testing: 2147483648 * 9 ---
+int(19327352832)
+--- testing: 2147483648 * 65 ---
+int(139586437120)
+--- testing: 2147483648 * -44 ---
+int(-94489280512)
+--- testing: 2147483648 * 2147483647 ---
+int(4611686016279904256)
+--- testing: 2147483648 * 9223372036854775807 ---
+float(1.9807040628566E+28)
+--- testing: -2147483649 * 0 ---
+int(0)
+--- testing: -2147483649 * 1 ---
+int(-2147483649)
+--- testing: -2147483649 * -1 ---
+int(2147483649)
+--- testing: -2147483649 * 7 ---
+int(-15032385543)
+--- testing: -2147483649 * 9 ---
+int(-19327352841)
+--- testing: -2147483649 * 65 ---
+int(-139586437185)
+--- testing: -2147483649 * -44 ---
+int(94489280556)
+--- testing: -2147483649 * 2147483647 ---
+int(-4611686018427387903)
+--- testing: -2147483649 * 9223372036854775807 ---
+float(-1.9807040637789E+28)
+--- testing: 4294967294 * 0 ---
+int(0)
+--- testing: 4294967294 * 1 ---
+int(4294967294)
+--- testing: 4294967294 * -1 ---
+int(-4294967294)
+--- testing: 4294967294 * 7 ---
+int(30064771058)
+--- testing: 4294967294 * 9 ---
+int(38654705646)
+--- testing: 4294967294 * 65 ---
+int(279172874110)
+--- testing: 4294967294 * -44 ---
+int(-188978560936)
+--- testing: 4294967294 * 2147483647 ---
+int(9223372028264841218)
+--- testing: 4294967294 * 9223372036854775807 ---
+float(3.9614081238685E+28)
+--- testing: 4294967295 * 0 ---
+int(0)
+--- testing: 4294967295 * 1 ---
+int(4294967295)
+--- testing: 4294967295 * -1 ---
+int(-4294967295)
+--- testing: 4294967295 * 7 ---
+int(30064771065)
+--- testing: 4294967295 * 9 ---
+int(38654705655)
+--- testing: 4294967295 * 65 ---
+int(279172874175)
+--- testing: 4294967295 * -44 ---
+int(-188978560980)
+--- testing: 4294967295 * 2147483647 ---
+int(9223372030412324865)
+--- testing: 4294967295 * 9223372036854775807 ---
+float(3.9614081247909E+28)
+--- testing: 4294967293 * 0 ---
+int(0)
+--- testing: 4294967293 * 1 ---
+int(4294967293)
+--- testing: 4294967293 * -1 ---
+int(-4294967293)
+--- testing: 4294967293 * 7 ---
+int(30064771051)
+--- testing: 4294967293 * 9 ---
+int(38654705637)
+--- testing: 4294967293 * 65 ---
+int(279172874045)
+--- testing: 4294967293 * -44 ---
+int(-188978560892)
+--- testing: 4294967293 * 2147483647 ---
+int(9223372026117357571)
+--- testing: 4294967293 * 9223372036854775807 ---
+float(3.9614081229462E+28)
+--- testing: 9223372036854775806 * 0 ---
+int(0)
+--- testing: 9223372036854775806 * 1 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 * -1 ---
+int(-9223372036854775806)
+--- testing: 9223372036854775806 * 7 ---
+float(6.4563604257983E+19)
+--- testing: 9223372036854775806 * 9 ---
+float(8.3010348331693E+19)
+--- testing: 9223372036854775806 * 65 ---
+float(5.9951918239556E+20)
+--- testing: 9223372036854775806 * -44 ---
+float(-4.0582836962161E+20)
+--- testing: 9223372036854775806 * 2147483647 ---
+float(1.9807040619343E+28)
+--- testing: 9223372036854775806 * 9223372036854775807 ---
+float(8.5070591730235E+37)
+--- testing: 9.2233720368548E+18 * 0 ---
+float(0)
+--- testing: 9.2233720368548E+18 * 1 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 * -1 ---
+float(-9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 * 7 ---
+float(6.4563604257983E+19)
+--- testing: 9.2233720368548E+18 * 9 ---
+float(8.3010348331693E+19)
+--- testing: 9.2233720368548E+18 * 65 ---
+float(5.9951918239556E+20)
+--- testing: 9.2233720368548E+18 * -44 ---
+float(-4.0582836962161E+20)
+--- testing: 9.2233720368548E+18 * 2147483647 ---
+float(1.9807040619343E+28)
+--- testing: 9.2233720368548E+18 * 9223372036854775807 ---
+float(8.5070591730235E+37)
+--- testing: -9223372036854775807 * 0 ---
+int(0)
+--- testing: -9223372036854775807 * 1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 * -1 ---
+int(9223372036854775807)
+--- testing: -9223372036854775807 * 7 ---
+float(-6.4563604257983E+19)
+--- testing: -9223372036854775807 * 9 ---
+float(-8.3010348331693E+19)
+--- testing: -9223372036854775807 * 65 ---
+float(-5.9951918239556E+20)
+--- testing: -9223372036854775807 * -44 ---
+float(4.0582836962161E+20)
+--- testing: -9223372036854775807 * 2147483647 ---
+float(-1.9807040619343E+28)
+--- testing: -9223372036854775807 * 9223372036854775807 ---
+float(-8.5070591730235E+37)
+--- testing: -9.2233720368548E+18 * 0 ---
+float(-0)
+--- testing: -9.2233720368548E+18 * 1 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 * -1 ---
+float(9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 * 7 ---
+float(-6.4563604257983E+19)
+--- testing: -9.2233720368548E+18 * 9 ---
+float(-8.3010348331693E+19)
+--- testing: -9.2233720368548E+18 * 65 ---
+float(-5.9951918239556E+20)
+--- testing: -9.2233720368548E+18 * -44 ---
+float(4.0582836962161E+20)
+--- testing: -9.2233720368548E+18 * 2147483647 ---
+float(-1.9807040619343E+28)
+--- testing: -9.2233720368548E+18 * 9223372036854775807 ---
+float(-8.5070591730235E+37)
+--- testing: 0 * 9223372036854775807 ---
+int(0)
+--- testing: 0 * -9223372036854775808 ---
+int(0)
+--- testing: 0 * 2147483647 ---
+int(0)
+--- testing: 0 * -2147483648 ---
+int(0)
+--- testing: 0 * 9223372034707292160 ---
+int(0)
+--- testing: 0 * -9223372034707292160 ---
+int(0)
+--- testing: 0 * 2147483648 ---
+int(0)
+--- testing: 0 * -2147483649 ---
+int(0)
+--- testing: 0 * 4294967294 ---
+int(0)
+--- testing: 0 * 4294967295 ---
+int(0)
+--- testing: 0 * 4294967293 ---
+int(0)
+--- testing: 0 * 9223372036854775806 ---
+int(0)
+--- testing: 0 * 9.2233720368548E+18 ---
+float(0)
+--- testing: 0 * -9223372036854775807 ---
+int(0)
+--- testing: 0 * -9.2233720368548E+18 ---
+float(-0)
+--- testing: 1 * 9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 1 * -9223372036854775808 ---
+int(-9223372036854775808)
+--- testing: 1 * 2147483647 ---
+int(2147483647)
+--- testing: 1 * -2147483648 ---
+int(-2147483648)
+--- testing: 1 * 9223372034707292160 ---
+int(9223372034707292160)
+--- testing: 1 * -9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: 1 * 2147483648 ---
+int(2147483648)
+--- testing: 1 * -2147483649 ---
+int(-2147483649)
+--- testing: 1 * 4294967294 ---
+int(4294967294)
+--- testing: 1 * 4294967295 ---
+int(4294967295)
+--- testing: 1 * 4294967293 ---
+int(4294967293)
+--- testing: 1 * 9223372036854775806 ---
+int(9223372036854775806)
+--- testing: 1 * 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 1 * -9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: 1 * -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: -1 * 9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: -1 * -9223372036854775808 ---
+float(9.2233720368548E+18)
+--- testing: -1 * 2147483647 ---
+int(-2147483647)
+--- testing: -1 * -2147483648 ---
+int(2147483648)
+--- testing: -1 * 9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: -1 * -9223372034707292160 ---
+int(9223372034707292160)
+--- testing: -1 * 2147483648 ---
+int(-2147483648)
+--- testing: -1 * -2147483649 ---
+int(2147483649)
+--- testing: -1 * 4294967294 ---
+int(-4294967294)
+--- testing: -1 * 4294967295 ---
+int(-4294967295)
+--- testing: -1 * 4294967293 ---
+int(-4294967293)
+--- testing: -1 * 9223372036854775806 ---
+int(-9223372036854775806)
+--- testing: -1 * 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: -1 * -9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -1 * -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 7 * 9223372036854775807 ---
+float(6.4563604257983E+19)
+--- testing: 7 * -9223372036854775808 ---
+float(-6.4563604257983E+19)
+--- testing: 7 * 2147483647 ---
+int(15032385529)
+--- testing: 7 * -2147483648 ---
+int(-15032385536)
+--- testing: 7 * 9223372034707292160 ---
+float(6.4563604242951E+19)
+--- testing: 7 * -9223372034707292160 ---
+float(-6.4563604242951E+19)
+--- testing: 7 * 2147483648 ---
+int(15032385536)
+--- testing: 7 * -2147483649 ---
+int(-15032385543)
+--- testing: 7 * 4294967294 ---
+int(30064771058)
+--- testing: 7 * 4294967295 ---
+int(30064771065)
+--- testing: 7 * 4294967293 ---
+int(30064771051)
+--- testing: 7 * 9223372036854775806 ---
+float(6.4563604257983E+19)
+--- testing: 7 * 9.2233720368548E+18 ---
+float(6.4563604257983E+19)
+--- testing: 7 * -9223372036854775807 ---
+float(-6.4563604257983E+19)
+--- testing: 7 * -9.2233720368548E+18 ---
+float(-6.4563604257983E+19)
+--- testing: 9 * 9223372036854775807 ---
+float(8.3010348331693E+19)
+--- testing: 9 * -9223372036854775808 ---
+float(-8.3010348331693E+19)
+--- testing: 9 * 2147483647 ---
+int(19327352823)
+--- testing: 9 * -2147483648 ---
+int(-19327352832)
+--- testing: 9 * 9223372034707292160 ---
+float(8.3010348312366E+19)
+--- testing: 9 * -9223372034707292160 ---
+float(-8.3010348312366E+19)
+--- testing: 9 * 2147483648 ---
+int(19327352832)
+--- testing: 9 * -2147483649 ---
+int(-19327352841)
+--- testing: 9 * 4294967294 ---
+int(38654705646)
+--- testing: 9 * 4294967295 ---
+int(38654705655)
+--- testing: 9 * 4294967293 ---
+int(38654705637)
+--- testing: 9 * 9223372036854775806 ---
+float(8.3010348331693E+19)
+--- testing: 9 * 9.2233720368548E+18 ---
+float(8.3010348331693E+19)
+--- testing: 9 * -9223372036854775807 ---
+float(-8.3010348331693E+19)
+--- testing: 9 * -9.2233720368548E+18 ---
+float(-8.3010348331693E+19)
+--- testing: 65 * 9223372036854775807 ---
+float(5.9951918239556E+20)
+--- testing: 65 * -9223372036854775808 ---
+float(-5.9951918239556E+20)
+--- testing: 65 * 2147483647 ---
+int(139586437055)
+--- testing: 65 * -2147483648 ---
+int(-139586437120)
+--- testing: 65 * 9223372034707292160 ---
+float(5.9951918225597E+20)
+--- testing: 65 * -9223372034707292160 ---
+float(-5.9951918225597E+20)
+--- testing: 65 * 2147483648 ---
+int(139586437120)
+--- testing: 65 * -2147483649 ---
+int(-139586437185)
+--- testing: 65 * 4294967294 ---
+int(279172874110)
+--- testing: 65 * 4294967295 ---
+int(279172874175)
+--- testing: 65 * 4294967293 ---
+int(279172874045)
+--- testing: 65 * 9223372036854775806 ---
+float(5.9951918239556E+20)
+--- testing: 65 * 9.2233720368548E+18 ---
+float(5.9951918239556E+20)
+--- testing: 65 * -9223372036854775807 ---
+float(-5.9951918239556E+20)
+--- testing: 65 * -9.2233720368548E+18 ---
+float(-5.9951918239556E+20)
+--- testing: -44 * 9223372036854775807 ---
+float(-4.0582836962161E+20)
+--- testing: -44 * -9223372036854775808 ---
+float(4.0582836962161E+20)
+--- testing: -44 * 2147483647 ---
+int(-94489280468)
+--- testing: -44 * -2147483648 ---
+int(94489280512)
+--- testing: -44 * 9223372034707292160 ---
+float(-4.0582836952712E+20)
+--- testing: -44 * -9223372034707292160 ---
+float(4.0582836952712E+20)
+--- testing: -44 * 2147483648 ---
+int(-94489280512)
+--- testing: -44 * -2147483649 ---
+int(94489280556)
+--- testing: -44 * 4294967294 ---
+int(-188978560936)
+--- testing: -44 * 4294967295 ---
+int(-188978560980)
+--- testing: -44 * 4294967293 ---
+int(-188978560892)
+--- testing: -44 * 9223372036854775806 ---
+float(-4.0582836962161E+20)
+--- testing: -44 * 9.2233720368548E+18 ---
+float(-4.0582836962161E+20)
+--- testing: -44 * -9223372036854775807 ---
+float(4.0582836962161E+20)
+--- testing: -44 * -9.2233720368548E+18 ---
+float(4.0582836962161E+20)
+--- testing: 2147483647 * 9223372036854775807 ---
+float(1.9807040619343E+28)
+--- testing: 2147483647 * -9223372036854775808 ---
+float(-1.9807040619343E+28)
+--- testing: 2147483647 * 2147483647 ---
+int(4611686014132420609)
+--- testing: 2147483647 * -2147483648 ---
+int(-4611686016279904256)
+--- testing: 2147483647 * 9223372034707292160 ---
+float(1.9807040614731E+28)
+--- testing: 2147483647 * -9223372034707292160 ---
+float(-1.9807040614731E+28)
+--- testing: 2147483647 * 2147483648 ---
+int(4611686016279904256)
+--- testing: 2147483647 * -2147483649 ---
+int(-4611686018427387903)
+--- testing: 2147483647 * 4294967294 ---
+int(9223372028264841218)
+--- testing: 2147483647 * 4294967295 ---
+int(9223372030412324865)
+--- testing: 2147483647 * 4294967293 ---
+int(9223372026117357571)
+--- testing: 2147483647 * 9223372036854775806 ---
+float(1.9807040619343E+28)
+--- testing: 2147483647 * 9.2233720368548E+18 ---
+float(1.9807040619343E+28)
+--- testing: 2147483647 * -9223372036854775807 ---
+float(-1.9807040619343E+28)
+--- testing: 2147483647 * -9.2233720368548E+18 ---
+float(-1.9807040619343E+28)
+--- testing: 9223372036854775807 * 9223372036854775807 ---
+float(8.5070591730235E+37)
+--- testing: 9223372036854775807 * -9223372036854775808 ---
+float(-8.5070591730235E+37)
+--- testing: 9223372036854775807 * 2147483647 ---
+float(1.9807040619343E+28)
+--- testing: 9223372036854775807 * -2147483648 ---
+float(-1.9807040628566E+28)
+--- testing: 9223372036854775807 * 9223372034707292160 ---
+float(8.5070591710428E+37)
+--- testing: 9223372036854775807 * -9223372034707292160 ---
+float(-8.5070591710428E+37)
+--- testing: 9223372036854775807 * 2147483648 ---
+float(1.9807040628566E+28)
+--- testing: 9223372036854775807 * -2147483649 ---
+float(-1.9807040637789E+28)
+--- testing: 9223372036854775807 * 4294967294 ---
+float(3.9614081238685E+28)
+--- testing: 9223372036854775807 * 4294967295 ---
+float(3.9614081247909E+28)
+--- testing: 9223372036854775807 * 4294967293 ---
+float(3.9614081229462E+28)
+--- testing: 9223372036854775807 * 9223372036854775806 ---
+float(8.5070591730235E+37)
+--- testing: 9223372036854775807 * 9.2233720368548E+18 ---
+float(8.5070591730235E+37)
+--- testing: 9223372036854775807 * -9223372036854775807 ---
+float(-8.5070591730235E+37)
+--- testing: 9223372036854775807 * -9.2233720368548E+18 ---
+float(-8.5070591730235E+37)
+===DONE===
diff --git a/tests/lang/operators/multiply_variationStr.phpt b/tests/lang/operators/multiply_variationStr.phpt
new file mode 100644
index 0000000..30d5f79
--- /dev/null
+++ b/tests/lang/operators/multiply_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test * operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' * '$otherVal' ---\n";
+ var_dump($strVal*$otherVal);
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' * '0' ---
+int(0)
+--- testing: '0' * '65' ---
+int(0)
+--- testing: '0' * '-44' ---
+int(0)
+--- testing: '0' * '1.2' ---
+float(0)
+--- testing: '0' * '-7.7' ---
+float(-0)
+--- testing: '0' * 'abc' ---
+int(0)
+--- testing: '0' * '123abc' ---
+int(0)
+--- testing: '0' * '123e5' ---
+float(0)
+--- testing: '0' * '123e5xyz' ---
+float(0)
+--- testing: '0' * ' 123abc' ---
+int(0)
+--- testing: '0' * '123 abc' ---
+int(0)
+--- testing: '0' * '123abc ' ---
+int(0)
+--- testing: '0' * '3.4a' ---
+float(0)
+--- testing: '0' * 'a5.9' ---
+int(0)
+--- testing: '65' * '0' ---
+int(0)
+--- testing: '65' * '65' ---
+int(4225)
+--- testing: '65' * '-44' ---
+int(-2860)
+--- testing: '65' * '1.2' ---
+float(78)
+--- testing: '65' * '-7.7' ---
+float(-500.5)
+--- testing: '65' * 'abc' ---
+int(0)
+--- testing: '65' * '123abc' ---
+int(7995)
+--- testing: '65' * '123e5' ---
+float(799500000)
+--- testing: '65' * '123e5xyz' ---
+float(799500000)
+--- testing: '65' * ' 123abc' ---
+int(7995)
+--- testing: '65' * '123 abc' ---
+int(7995)
+--- testing: '65' * '123abc ' ---
+int(7995)
+--- testing: '65' * '3.4a' ---
+float(221)
+--- testing: '65' * 'a5.9' ---
+int(0)
+--- testing: '-44' * '0' ---
+int(0)
+--- testing: '-44' * '65' ---
+int(-2860)
+--- testing: '-44' * '-44' ---
+int(1936)
+--- testing: '-44' * '1.2' ---
+float(-52.8)
+--- testing: '-44' * '-7.7' ---
+float(338.8)
+--- testing: '-44' * 'abc' ---
+int(0)
+--- testing: '-44' * '123abc' ---
+int(-5412)
+--- testing: '-44' * '123e5' ---
+float(-541200000)
+--- testing: '-44' * '123e5xyz' ---
+float(-541200000)
+--- testing: '-44' * ' 123abc' ---
+int(-5412)
+--- testing: '-44' * '123 abc' ---
+int(-5412)
+--- testing: '-44' * '123abc ' ---
+int(-5412)
+--- testing: '-44' * '3.4a' ---
+float(-149.6)
+--- testing: '-44' * 'a5.9' ---
+int(0)
+--- testing: '1.2' * '0' ---
+float(0)
+--- testing: '1.2' * '65' ---
+float(78)
+--- testing: '1.2' * '-44' ---
+float(-52.8)
+--- testing: '1.2' * '1.2' ---
+float(1.44)
+--- testing: '1.2' * '-7.7' ---
+float(-9.24)
+--- testing: '1.2' * 'abc' ---
+float(0)
+--- testing: '1.2' * '123abc' ---
+float(147.6)
+--- testing: '1.2' * '123e5' ---
+float(14760000)
+--- testing: '1.2' * '123e5xyz' ---
+float(14760000)
+--- testing: '1.2' * ' 123abc' ---
+float(147.6)
+--- testing: '1.2' * '123 abc' ---
+float(147.6)
+--- testing: '1.2' * '123abc ' ---
+float(147.6)
+--- testing: '1.2' * '3.4a' ---
+float(4.08)
+--- testing: '1.2' * 'a5.9' ---
+float(0)
+--- testing: '-7.7' * '0' ---
+float(-0)
+--- testing: '-7.7' * '65' ---
+float(-500.5)
+--- testing: '-7.7' * '-44' ---
+float(338.8)
+--- testing: '-7.7' * '1.2' ---
+float(-9.24)
+--- testing: '-7.7' * '-7.7' ---
+float(59.29)
+--- testing: '-7.7' * 'abc' ---
+float(-0)
+--- testing: '-7.7' * '123abc' ---
+float(-947.1)
+--- testing: '-7.7' * '123e5' ---
+float(-94710000)
+--- testing: '-7.7' * '123e5xyz' ---
+float(-94710000)
+--- testing: '-7.7' * ' 123abc' ---
+float(-947.1)
+--- testing: '-7.7' * '123 abc' ---
+float(-947.1)
+--- testing: '-7.7' * '123abc ' ---
+float(-947.1)
+--- testing: '-7.7' * '3.4a' ---
+float(-26.18)
+--- testing: '-7.7' * 'a5.9' ---
+float(-0)
+--- testing: 'abc' * '0' ---
+int(0)
+--- testing: 'abc' * '65' ---
+int(0)
+--- testing: 'abc' * '-44' ---
+int(0)
+--- testing: 'abc' * '1.2' ---
+float(0)
+--- testing: 'abc' * '-7.7' ---
+float(-0)
+--- testing: 'abc' * 'abc' ---
+int(0)
+--- testing: 'abc' * '123abc' ---
+int(0)
+--- testing: 'abc' * '123e5' ---
+float(0)
+--- testing: 'abc' * '123e5xyz' ---
+float(0)
+--- testing: 'abc' * ' 123abc' ---
+int(0)
+--- testing: 'abc' * '123 abc' ---
+int(0)
+--- testing: 'abc' * '123abc ' ---
+int(0)
+--- testing: 'abc' * '3.4a' ---
+float(0)
+--- testing: 'abc' * 'a5.9' ---
+int(0)
+--- testing: '123abc' * '0' ---
+int(0)
+--- testing: '123abc' * '65' ---
+int(7995)
+--- testing: '123abc' * '-44' ---
+int(-5412)
+--- testing: '123abc' * '1.2' ---
+float(147.6)
+--- testing: '123abc' * '-7.7' ---
+float(-947.1)
+--- testing: '123abc' * 'abc' ---
+int(0)
+--- testing: '123abc' * '123abc' ---
+int(15129)
+--- testing: '123abc' * '123e5' ---
+float(1512900000)
+--- testing: '123abc' * '123e5xyz' ---
+float(1512900000)
+--- testing: '123abc' * ' 123abc' ---
+int(15129)
+--- testing: '123abc' * '123 abc' ---
+int(15129)
+--- testing: '123abc' * '123abc ' ---
+int(15129)
+--- testing: '123abc' * '3.4a' ---
+float(418.2)
+--- testing: '123abc' * 'a5.9' ---
+int(0)
+--- testing: '123e5' * '0' ---
+float(0)
+--- testing: '123e5' * '65' ---
+float(799500000)
+--- testing: '123e5' * '-44' ---
+float(-541200000)
+--- testing: '123e5' * '1.2' ---
+float(14760000)
+--- testing: '123e5' * '-7.7' ---
+float(-94710000)
+--- testing: '123e5' * 'abc' ---
+float(0)
+--- testing: '123e5' * '123abc' ---
+float(1512900000)
+--- testing: '123e5' * '123e5' ---
+float(1.5129E+14)
+--- testing: '123e5' * '123e5xyz' ---
+float(1.5129E+14)
+--- testing: '123e5' * ' 123abc' ---
+float(1512900000)
+--- testing: '123e5' * '123 abc' ---
+float(1512900000)
+--- testing: '123e5' * '123abc ' ---
+float(1512900000)
+--- testing: '123e5' * '3.4a' ---
+float(41820000)
+--- testing: '123e5' * 'a5.9' ---
+float(0)
+--- testing: '123e5xyz' * '0' ---
+float(0)
+--- testing: '123e5xyz' * '65' ---
+float(799500000)
+--- testing: '123e5xyz' * '-44' ---
+float(-541200000)
+--- testing: '123e5xyz' * '1.2' ---
+float(14760000)
+--- testing: '123e5xyz' * '-7.7' ---
+float(-94710000)
+--- testing: '123e5xyz' * 'abc' ---
+float(0)
+--- testing: '123e5xyz' * '123abc' ---
+float(1512900000)
+--- testing: '123e5xyz' * '123e5' ---
+float(1.5129E+14)
+--- testing: '123e5xyz' * '123e5xyz' ---
+float(1.5129E+14)
+--- testing: '123e5xyz' * ' 123abc' ---
+float(1512900000)
+--- testing: '123e5xyz' * '123 abc' ---
+float(1512900000)
+--- testing: '123e5xyz' * '123abc ' ---
+float(1512900000)
+--- testing: '123e5xyz' * '3.4a' ---
+float(41820000)
+--- testing: '123e5xyz' * 'a5.9' ---
+float(0)
+--- testing: ' 123abc' * '0' ---
+int(0)
+--- testing: ' 123abc' * '65' ---
+int(7995)
+--- testing: ' 123abc' * '-44' ---
+int(-5412)
+--- testing: ' 123abc' * '1.2' ---
+float(147.6)
+--- testing: ' 123abc' * '-7.7' ---
+float(-947.1)
+--- testing: ' 123abc' * 'abc' ---
+int(0)
+--- testing: ' 123abc' * '123abc' ---
+int(15129)
+--- testing: ' 123abc' * '123e5' ---
+float(1512900000)
+--- testing: ' 123abc' * '123e5xyz' ---
+float(1512900000)
+--- testing: ' 123abc' * ' 123abc' ---
+int(15129)
+--- testing: ' 123abc' * '123 abc' ---
+int(15129)
+--- testing: ' 123abc' * '123abc ' ---
+int(15129)
+--- testing: ' 123abc' * '3.4a' ---
+float(418.2)
+--- testing: ' 123abc' * 'a5.9' ---
+int(0)
+--- testing: '123 abc' * '0' ---
+int(0)
+--- testing: '123 abc' * '65' ---
+int(7995)
+--- testing: '123 abc' * '-44' ---
+int(-5412)
+--- testing: '123 abc' * '1.2' ---
+float(147.6)
+--- testing: '123 abc' * '-7.7' ---
+float(-947.1)
+--- testing: '123 abc' * 'abc' ---
+int(0)
+--- testing: '123 abc' * '123abc' ---
+int(15129)
+--- testing: '123 abc' * '123e5' ---
+float(1512900000)
+--- testing: '123 abc' * '123e5xyz' ---
+float(1512900000)
+--- testing: '123 abc' * ' 123abc' ---
+int(15129)
+--- testing: '123 abc' * '123 abc' ---
+int(15129)
+--- testing: '123 abc' * '123abc ' ---
+int(15129)
+--- testing: '123 abc' * '3.4a' ---
+float(418.2)
+--- testing: '123 abc' * 'a5.9' ---
+int(0)
+--- testing: '123abc ' * '0' ---
+int(0)
+--- testing: '123abc ' * '65' ---
+int(7995)
+--- testing: '123abc ' * '-44' ---
+int(-5412)
+--- testing: '123abc ' * '1.2' ---
+float(147.6)
+--- testing: '123abc ' * '-7.7' ---
+float(-947.1)
+--- testing: '123abc ' * 'abc' ---
+int(0)
+--- testing: '123abc ' * '123abc' ---
+int(15129)
+--- testing: '123abc ' * '123e5' ---
+float(1512900000)
+--- testing: '123abc ' * '123e5xyz' ---
+float(1512900000)
+--- testing: '123abc ' * ' 123abc' ---
+int(15129)
+--- testing: '123abc ' * '123 abc' ---
+int(15129)
+--- testing: '123abc ' * '123abc ' ---
+int(15129)
+--- testing: '123abc ' * '3.4a' ---
+float(418.2)
+--- testing: '123abc ' * 'a5.9' ---
+int(0)
+--- testing: '3.4a' * '0' ---
+float(0)
+--- testing: '3.4a' * '65' ---
+float(221)
+--- testing: '3.4a' * '-44' ---
+float(-149.6)
+--- testing: '3.4a' * '1.2' ---
+float(4.08)
+--- testing: '3.4a' * '-7.7' ---
+float(-26.18)
+--- testing: '3.4a' * 'abc' ---
+float(0)
+--- testing: '3.4a' * '123abc' ---
+float(418.2)
+--- testing: '3.4a' * '123e5' ---
+float(41820000)
+--- testing: '3.4a' * '123e5xyz' ---
+float(41820000)
+--- testing: '3.4a' * ' 123abc' ---
+float(418.2)
+--- testing: '3.4a' * '123 abc' ---
+float(418.2)
+--- testing: '3.4a' * '123abc ' ---
+float(418.2)
+--- testing: '3.4a' * '3.4a' ---
+float(11.56)
+--- testing: '3.4a' * 'a5.9' ---
+float(0)
+--- testing: 'a5.9' * '0' ---
+int(0)
+--- testing: 'a5.9' * '65' ---
+int(0)
+--- testing: 'a5.9' * '-44' ---
+int(0)
+--- testing: 'a5.9' * '1.2' ---
+float(0)
+--- testing: 'a5.9' * '-7.7' ---
+float(-0)
+--- testing: 'a5.9' * 'abc' ---
+int(0)
+--- testing: 'a5.9' * '123abc' ---
+int(0)
+--- testing: 'a5.9' * '123e5' ---
+float(0)
+--- testing: 'a5.9' * '123e5xyz' ---
+float(0)
+--- testing: 'a5.9' * ' 123abc' ---
+int(0)
+--- testing: 'a5.9' * '123 abc' ---
+int(0)
+--- testing: 'a5.9' * '123abc ' ---
+int(0)
+--- testing: 'a5.9' * '3.4a' ---
+float(0)
+--- testing: 'a5.9' * 'a5.9' ---
+int(0)
+===DONE===
diff --git a/tests/lang/operators/negate_basiclong_64bit.phpt b/tests/lang/operators/negate_basiclong_64bit.phpt
new file mode 100644
index 0000000..e0cf10d
--- /dev/null
+++ b/tests/lang/operators/negate_basiclong_64bit.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Test -N operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+
+foreach ($longVals as $longVal) {
+ echo "--- testing: $longVal ---\n";
+ var_dump(-$longVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775808 ---
+float(9.2233720368548E+18)
+--- testing: 2147483647 ---
+int(-2147483647)
+--- testing: -2147483648 ---
+int(2147483648)
+--- testing: 9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 ---
+int(9223372034707292160)
+--- testing: 2147483648 ---
+int(-2147483648)
+--- testing: -2147483649 ---
+int(2147483649)
+--- testing: 4294967294 ---
+int(-4294967294)
+--- testing: 4294967295 ---
+int(-4294967295)
+--- testing: 4294967293 ---
+int(-4294967293)
+--- testing: 9223372036854775806 ---
+int(-9223372036854775806)
+--- testing: 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775807 ---
+int(9223372036854775807)
+--- testing: -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+===DONE===
diff --git a/tests/lang/operators/negate_variationStr.phpt b/tests/lang/operators/negate_variationStr.phpt
new file mode 100644
index 0000000..a25bdda
--- /dev/null
+++ b/tests/lang/operators/negate_variationStr.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Test -N operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+
+foreach ($strVals as $strVal) {
+ echo "--- testing: '$strVal' ---\n";
+ var_dump(-$strVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' ---
+int(0)
+--- testing: '65' ---
+int(-65)
+--- testing: '-44' ---
+int(44)
+--- testing: '1.2' ---
+float(-1.2)
+--- testing: '-7.7' ---
+float(7.7)
+--- testing: 'abc' ---
+int(0)
+--- testing: '123abc' ---
+int(-123)
+--- testing: '123e5' ---
+float(-12300000)
+--- testing: '123e5xyz' ---
+float(-12300000)
+--- testing: ' 123abc' ---
+int(-123)
+--- testing: '123 abc' ---
+int(-123)
+--- testing: '123abc ' ---
+int(-123)
+--- testing: '3.4a' ---
+float(-3.4)
+--- testing: 'a5.9' ---
+int(0)
+===DONE===
diff --git a/tests/lang/operators/operator_equals_basic.phpt b/tests/lang/operators/operator_equals_basic.phpt
new file mode 100644
index 0000000..1b42fc3
--- /dev/null
+++ b/tests/lang/operators/operator_equals_basic.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test == operator : different types
+--FILE--
+<?php
+
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 679;
+$int2 = -67835;
+$valid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", +679);
+$valid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4);
+$invalid_int1 = array("6 7 9", "6y79", 678);
+$invalid_int2 = array("- 67835", "-67,835", "-67 835", "-678y35", -76834);
+
+$float1 = 57385.45835;
+$float2 = -67345.76567;
+$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4);
+$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4);
+$invalid_float1 = array("57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4);
+$invalid_float2 = array("- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4);
+
+
+$toCompare = array(
+ true, $valid_true, $valid_false,
+ false, $valid_false, $valid_true,
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest == $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' != '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest == $compareVal) {
+ echo "FAILED: '$typeToTest' == '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_equals_variation.phpt b/tests/lang/operators/operator_equals_variation.phpt
new file mode 100644
index 0000000..60e6abb
--- /dev/null
+++ b/tests/lang/operators/operator_equals_variation.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Test == operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validEqual = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1),
+);
+
+$invalidEqual = array (
+MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validEqual); $i +=2) {
+ $typeToTestVal = $validEqual[$i];
+ $compares = $validEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal == $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' != '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test invalid values
+for ($i = 0; $i < count($invalidEqual); $i +=2) {
+ $typeToTestVal = $invalidEqual[$i];
+ $compares = $invalidEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal == $compareVal) {
+ echo "FAILED: '$typeToTestVal' == '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_equals_variation_64bit.phpt b/tests/lang/operators/operator_equals_variation_64bit.phpt
new file mode 100644
index 0000000..b521735
--- /dev/null
+++ b/tests/lang/operators/operator_equals_variation_64bit.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test == operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validEqual = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1),
+);
+
+$invalidEqual = array (
+MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+MAX_64Bit, array(MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit + 1),
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validEqual); $i +=2) {
+ $typeToTestVal = $validEqual[$i];
+ $compares = $validEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal == $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' != '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test invalid values
+for ($i = 0; $i < count($invalidEqual); $i +=2) {
+ $typeToTestVal = $invalidEqual[$i];
+ $compares = $invalidEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal == $compareVal) {
+ echo "FAILED: '$typeToTestVal' == '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_gt_basic.phpt b/tests/lang/operators/operator_gt_basic.phpt
new file mode 100644
index 0000000..06fbcee
--- /dev/null
+++ b/tests/lang/operators/operator_gt_basic.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test > operator : different types
+--FILE--
+<?php
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 679;
+$int2 = -67835;
+$valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678);
+$valid_int2 = array("-67836", "-67836abc", " -67836", "-67836 ", -67835.0001, -6.78351E4);
+$invalid_int1 = array(679, "679");
+$invalid_int2 = array(-67835, "-67835");
+
+$float1 = 57385.45835;
+$float2 = -67345.76567;
+$valid_float1 = array("57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4);
+$valid_float2 = array("-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4);
+$invalid_float1 = array(57385.45835, 5.738545835e4);
+$invalid_float2 = array(-67345.76567, -6.734576567E4);
+
+
+$toCompare = array(
+// boolean test will result in both sides being converted to boolean so !0 = true and true is not > true for example
+// also note that a string of "0" is converted to false but a string of "0.0" is converted to true
+// false cannot be tested as 0 can never be > 0 or 1
+ true, $valid_false, $valid_true,
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest > $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' <= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest > $compareVal) {
+ echo "FAILED: '$typeToTest' > '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_gt_or_equal_basic.phpt b/tests/lang/operators/operator_gt_or_equal_basic.phpt
new file mode 100644
index 0000000..02a561c
--- /dev/null
+++ b/tests/lang/operators/operator_gt_or_equal_basic.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test >= operator : different types
+--FILE--
+<?php
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 679;
+$int2 = -67835;
+$valid_int1 = array("679", "679abc", " 679", 679.0, 6.79E2, "678", "678abc", " 678", 678.0, 6.78E2, 6.789E2, "+678", +678);
+$valid_int2 = array("-67835", "-67835abc", " -67835", -67835.000, -6.7835E4, "-67836", "-67836abc". " -67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4);
+$invalid_int1 = array(680, "680");
+$invalid_int2 = array(-67834, "-67834");
+
+$float1 = 57385.45835;
+$float2 = -67345.76567;
+$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4, "57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4);
+$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4, "-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4);
+$invalid_float1 = array(57385.45836, 5.738545836e4);
+$invalid_float2 = array(-67345.76564, -6.734576564E4);
+
+$toCompare = array(
+
+ true, array_merge($valid_false, $valid_true), NULL,
+ false, $valid_false, $valid_true,
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest >= $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' < '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ if ($invalid_compares != NULL) {
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest >= $compareVal) {
+ echo "FAILED: '$typeToTest' >= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_gt_or_equal_variation.phpt b/tests/lang/operators/operator_gt_or_equal_variation.phpt
new file mode 100644
index 0000000..c4253b5
--- /dev/null
+++ b/tests/lang/operators/operator_gt_or_equal_variation.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Test >= operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validGtOrEqual = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit - 1),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit - 1),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1),
+);
+
+$invalidGtOrEqual = array (
+MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit + 1),
+MIN_32Bit, array(MIN_32Bit + 1,"-2147483646", -2.1474836460001e9)
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validGtOrEqual); $i +=2) {
+ $typeToTestVal = $validGtOrEqual[$i];
+ $compares = $validGtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal >= $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' < '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) {
+ $typeToTestVal = $invalidGtOrEqual[$i];
+ $compares = $invalidGtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal >= $compareVal) {
+ echo "FAILED: '$typeToTestVal' >= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt b/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt
new file mode 100644
index 0000000..a2f7aa4
--- /dev/null
+++ b/tests/lang/operators/operator_gt_or_equal_variation_64bit.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Test >= operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validGtOrEqual = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit - 1),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit - 1),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1),
+);
+
+$invalidGtOrEqual = array (
+MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit + 1),
+MIN_32Bit, array(MIN_32Bit + 1,"-2147483646", -2.1474836460001e9)
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validGtOrEqual); $i +=2) {
+ $typeToTestVal = $validGtOrEqual[$i];
+ $compares = $validGtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal >= $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' < '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidGtOrEqual); $i +=2) {
+ $typeToTestVal = $invalidGtOrEqual[$i];
+ $compares = $invalidGtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal >= $compareVal) {
+ echo "FAILED: '$typeToTestVal' >= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_gt_variation.phpt b/tests/lang/operators/operator_gt_variation.phpt
new file mode 100644
index 0000000..a158824
--- /dev/null
+++ b/tests/lang/operators/operator_gt_variation.phpt
@@ -0,0 +1,62 @@
+--TEST--
+Test > operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validGreaterThan = array (
+MAX_32Bit, array(MAX_32Bit - 1, "2147483646", "2147483646.999", 2.147483646e9, 2147483646.9, MIN_32Bit),
+-2147483647, array(MIN_32Bit, "-2147483648", "-2147483647.001", -2.1474836471e9, -2147483647.9),
+);
+
+$invalidGreaterThan = array (
+MAX_32Bit, array(2e33, MAX_32Bit + 1),
+MIN_32Bit, array(MIN_32Bit + 1, MAX_32Bit)
+);
+
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validGreaterThan); $i +=2) {
+ $typeToTestVal = $validGreaterThan[$i];
+ $compares = $validGreaterThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal > $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' <= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidGreaterThan); $i +=2) {
+ $typeToTestVal = $invalidGreaterThan[$i];
+ $compares = $invalidGreaterThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal > $compareVal) {
+ echo "FAILED: '$typeToTestVal' > '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_gt_variation_64bit.phpt b/tests/lang/operators/operator_gt_variation_64bit.phpt
new file mode 100644
index 0000000..6223e07
--- /dev/null
+++ b/tests/lang/operators/operator_gt_variation_64bit.phpt
@@ -0,0 +1,62 @@
+--TEST--
+Test > operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validGreaterThan = array (
+MAX_32Bit, array(MAX_32Bit - 1, "2147483646", "2147483646.999", 2.147483646e9, 2147483646.9, MIN_32Bit),
+-2147483647, array(MIN_32Bit, "-2147483648", "-2147483647.001", -2.1474836471e9, -2147483647.9),
+);
+
+$invalidGreaterThan = array (
+MAX_32Bit, array(2e33, MAX_32Bit + 1),
+MIN_32Bit, array(MIN_32Bit + 1, MAX_32Bit)
+);
+
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validGreaterThan); $i +=2) {
+ $typeToTestVal = $validGreaterThan[$i];
+ $compares = $validGreaterThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal > $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' <= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidGreaterThan); $i +=2) {
+ $typeToTestVal = $invalidGreaterThan[$i];
+ $compares = $invalidGreaterThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal > $compareVal) {
+ echo "FAILED: '$typeToTestVal' > '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_identical_basic.phpt b/tests/lang/operators/operator_identical_basic.phpt
new file mode 100644
index 0000000..a4cd8a0
--- /dev/null
+++ b/tests/lang/operators/operator_identical_basic.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test === operator : different types
+--FILE--
+<?php
+
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 679;
+$int2 = -67835;
+$valid_int1 = array(679, +679);
+$valid_int2 = array(-67835);
+$invalid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", "6 7 9", "6y79", 678);
+$invalid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4, "- 67835", "-67,835", "-67 835", "-678y35", -76834);
+
+$float1 = 57385.45835;
+$float2 = -67345.76567;
+$valid_float1 = array(57385.45835, 5.738545835e4);
+$valid_float2 = array(-67345.76567, -6.734576567E4);
+$invalid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4);
+$invalid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4);
+
+
+$toCompare = array(
+ true, array(true), array_merge($valid_true, $valid_false),
+ false, array(false), array_merge($valid_true, $valid_false),
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest === $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' != '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest === $compareVal) {
+ echo "FAILED: '$typeToTest' == '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_identical_variation.phpt b/tests/lang/operators/operator_identical_variation.phpt
new file mode 100644
index 0000000..76639c7
--- /dev/null
+++ b/tests/lang/operators/operator_identical_variation.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Test === operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validIdentical = array (
+MAX_32Bit, array(MAX_32Bit),
+MIN_32Bit, array(MIN_32Bit),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1),
+);
+
+$invalidIdentical = array (
+MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+);
+
+
+$failed = false;
+// test for valid values
+for ($i = 0; $i < count($validIdentical); $i +=2) {
+ $typeToTestVal = $validIdentical[$i];
+ $compares = $validIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal === $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' !== '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidIdentical); $i +=2) {
+ $typeToTestVal = $invalidIdentical[$i];
+ $compares = $invalidIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal === $compareVal) {
+ echo "FAILED: '$typeToTestVal' === '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_identical_variation_64bit.phpt b/tests/lang/operators/operator_identical_variation_64bit.phpt
new file mode 100644
index 0000000..0909c44
--- /dev/null
+++ b/tests/lang/operators/operator_identical_variation_64bit.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test === operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validIdentical = array (
+MAX_32Bit, array(MAX_32Bit),
+MIN_32Bit, array(MIN_32Bit),
+MAX_64Bit, array(MAX_64Bit),
+MIN_64Bit, array(MIN_64Bit),
+);
+
+$invalidIdentical = array (
+MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+MAX_64Bit, array(MAX_64Bit - 1, MAX_64Bit + 1),
+MIN_64Bit, array(MIN_64Bit + 1, MIN_64Bit - 1),
+);
+
+
+$failed = false;
+// test for valid values
+for ($i = 0; $i < count($validIdentical); $i +=2) {
+ $typeToTestVal = $validIdentical[$i];
+ $compares = $validIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal === $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' !== '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidIdentical); $i +=2) {
+ $typeToTestVal = $invalidIdentical[$i];
+ $compares = $invalidIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal === $compareVal) {
+ echo "FAILED: '$typeToTestVal' === '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_lt_basic.phpt b/tests/lang/operators/operator_lt_basic.phpt
new file mode 100644
index 0000000..137adf2
--- /dev/null
+++ b/tests/lang/operators/operator_lt_basic.phpt
@@ -0,0 +1,62 @@
+--TEST--
+Test < operator : different types
+--FILE--
+<?php
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 677;
+$int2 = -67837;
+$valid_int1 = array("678", "678abc", " 678", "678 ", 678.0, 6.789E2, "+678", +678);
+$valid_int2 = array("-67836", "-67836abc", " -67836", "-67836 ", -67835.0001, -6.78351E4);
+$invalid_int1 = array(676, "676");
+$invalid_int2 = array(-67837, "-67837");
+
+$float1 = 57385.45835;
+$float2 = -67345.76567;
+$valid_float1 = array("57385.45836", "57385.45836aaa", " 57385.45836", 5.738545836e4);
+$valid_float2 = array("-67345.76566", "-67345.76566aaa", " -67345.76566", -6.734576566E4);
+$invalid_float1 = array(57385.45835, 5.738545835e4);
+$invalid_float2 = array(-67345.76567, -6.734576567E4);
+
+
+$toCompare = array(
+ false, $valid_true, $valid_false,
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest < $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' >= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest < $compareVal) {
+ echo "FAILED: '$typeToTest' < '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_lt_or_equal_basic.phpt b/tests/lang/operators/operator_lt_or_equal_basic.phpt
new file mode 100644
index 0000000..381b813
--- /dev/null
+++ b/tests/lang/operators/operator_lt_or_equal_basic.phpt
@@ -0,0 +1,64 @@
+--TEST--
+Test <= operator : different types
+--FILE--
+<?php
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 678;
+$int2 = -67836;
+$valid_int1 = array("679", "679abc", " 679", 679.0, 6.79E2, "678", "678abc", " 678", 678.0, 6.78E2, 6.789E2, "+678", +678);
+$valid_int2 = array("-67835", "-67835abc", " -67835", -67835.000, -6.7835E4, "-67836", "-67836abc". " -67836", -67835.0001, -6.78351E4, "-67836", -67835.0001, -6.78351E4);
+$invalid_int1 = array(677, "677");
+$invalid_int2 = array(-67874, "-67837");
+
+$float1 = 57385.45834;
+$float2 = -67345.76568;
+$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4, "57385.45834", "57385.45834aaa", " 57385.45834", 5.738545834e4);
+$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4, "-67345.76568", "-67345.76568aaa", " -67345.76568", -6.734576568E4);
+$invalid_float1 = array(57385.45833, 5.738545833e4);
+$invalid_float2 = array(-67345.76569, -6.734576569E4);
+
+$toCompare = array(
+ true, $valid_true, $valid_false,
+ false, array_merge($valid_false, $valid_true), NULL,
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest <= $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' > '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ if ($invalid_compares != NULL) {
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest <= $compareVal) {
+ echo "FAILED: '$typeToTest' <= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_lt_or_equal_variation.phpt b/tests/lang/operators/operator_lt_or_equal_variation.phpt
new file mode 100644
index 0000000..8f5f945
--- /dev/null
+++ b/tests/lang/operators/operator_lt_or_equal_variation.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Test <= operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validLtOrEqual = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit + 1),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit + 1),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1),
+);
+
+$invalidLtOrEqual = array (
+MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1),
+MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9)
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validLtOrEqual); $i +=2) {
+ $typeToTestVal = $validLtOrEqual[$i];
+ $compares = $validLtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal <= $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' > '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test invalid values
+for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) {
+ $typeToTestVal = $invalidLtOrEqual[$i];
+ $compares = $invalidLtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal <= $compareVal) {
+ echo "FAILED: '$typeToTestVal' <= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt b/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt
new file mode 100644
index 0000000..03c974f
--- /dev/null
+++ b/tests/lang/operators/operator_lt_or_equal_variation_64bit.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Test <= operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validLtOrEqual = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, MAX_32Bit + 1),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, MIN_32Bit + 1),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1),
+);
+
+$invalidLtOrEqual = array (
+MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1),
+MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9)
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validLtOrEqual); $i +=2) {
+ $typeToTestVal = $validLtOrEqual[$i];
+ $compares = $validLtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal <= $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' > '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test invalid values
+for ($i = 0; $i < count($invalidLtOrEqual); $i +=2) {
+ $typeToTestVal = $invalidLtOrEqual[$i];
+ $compares = $invalidLtOrEqual[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal <= $compareVal) {
+ echo "FAILED: '$typeToTestVal' <= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_lt_variation.phpt b/tests/lang/operators/operator_lt_variation.phpt
new file mode 100644
index 0000000..a2a8f6a
--- /dev/null
+++ b/tests/lang/operators/operator_lt_variation.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Test < operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validLessThan = array (
+2147483646, array(MAX_32Bit, "2147483647", "2147483647.001", 2.147483647e9, 2147483647.9),
+MIN_32Bit, array(MIN_32Bit + 1, "-2147483647", "-2147483646.001", -2.1474836461e9, -2147483646.9),
+);
+
+$invalidLessThan = array (
+MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1),
+MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9)
+);
+
+$failed = false;
+// test for equality
+for ($i = 0; $i < count($validLessThan); $i +=2) {
+ $typeToTestVal = $validLessThan[$i];
+ $compares = $validLessThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal < $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' >= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidLessThan); $i +=2) {
+ $typeToTestVal = $invalidLessThan[$i];
+ $compares = $invalidLessThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal < $compareVal) {
+ echo "FAILED: '$typeToTestVal' < '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_lt_variation_64bit.phpt b/tests/lang/operators/operator_lt_variation_64bit.phpt
new file mode 100644
index 0000000..172ef39
--- /dev/null
+++ b/tests/lang/operators/operator_lt_variation_64bit.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Test < operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$validLessThan = array (
+2147483646, array(MAX_32Bit, "2147483647", "2147483647.001", 2.147483647e9, 2147483647.9),
+MIN_32Bit, array(MIN_32Bit + 1, "-2147483647", "-2147483646.001", -2.1474836461e9, -2147483646.9),
+);
+
+$invalidLessThan = array (
+MAX_32Bit, array("2147483646", 2.1474836460001e9, MAX_32Bit - 1),
+MIN_32Bit, array(MIN_32Bit - 1, "-2147483649", -2.1474836480001e9)
+);
+
+$failed = false;
+// test for equality
+for ($i = 0; $i < count($validLessThan); $i +=2) {
+ $typeToTestVal = $validLessThan[$i];
+ $compares = $validLessThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal < $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' >= '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidLessThan); $i +=2) {
+ $typeToTestVal = $invalidLessThan[$i];
+ $compares = $invalidLessThan[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal < $compareVal) {
+ echo "FAILED: '$typeToTestVal' < '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_notequals_basic.phpt b/tests/lang/operators/operator_notequals_basic.phpt
new file mode 100644
index 0000000..059c99d
--- /dev/null
+++ b/tests/lang/operators/operator_notequals_basic.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test != operator : different types
+--FILE--
+<?php
+
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 679;
+$int2 = -67835;
+$valid_int1 = array("6 7 9", "6y79", 678);
+$valid_int2 = array("- 67835", "-67,835", "-67 835", "-678y35", -76834);
+$invalid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", +679);
+$invalid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4);
+
+$float1 = 57385.45835;
+$float2 = -67345.76567;
+$valid_float1 = array("57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4);
+$valid_float2 = array("- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4);
+$invalid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", 5.738545835e4);
+$invalid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", -6.734576567E4);
+
+
+$toCompare = array(
+ true, $valid_false, $valid_true,
+ false, $valid_true, $valid_false,
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest != $compareVal && $typeToTest <> $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' == '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest != $compareVal || $typeToTest <> $compareVal) {
+ echo "FAILED: '$typeToTest' != '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_notequals_variation.phpt b/tests/lang/operators/operator_notequals_variation.phpt
new file mode 100644
index 0000000..a7827b4
--- /dev/null
+++ b/tests/lang/operators/operator_notequals_variation.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Test != operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$invalidNotEquals = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1),
+);
+
+$validNotEquals = array (
+MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validNotEquals); $i +=2) {
+ $typeToTestVal = $validNotEquals[$i];
+ $compares = $validNotEquals[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal != $compareVal && $typeToTestVal != $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' == '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test invalid values
+for ($i = 0; $i < count($invalidNotEquals); $i +=2) {
+ $typeToTestVal = $invalidNotEquals[$i];
+ $compares = $invalidNotEquals[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal != $compareVal || $typeToTestVal != $compareVal) {
+ echo "FAILED: '$typeToTestVal' != '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_notequals_variation_64bit.phpt b/tests/lang/operators/operator_notequals_variation_64bit.phpt
new file mode 100644
index 0000000..ed26b52
--- /dev/null
+++ b/tests/lang/operators/operator_notequals_variation_64bit.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test == operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$invalidNotEquals = array (
+MAX_32Bit, array(MAX_32Bit, "2147483647", "2147483647.0000000", 2.147483647e9),
+MIN_32Bit, array(MIN_32Bit, "-2147483648", "-2147483648.000", -2.147483648e9),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1),
+);
+
+$validNotEquals = array (
+MAX_32Bit, array("2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+MAX_64Bit, array(MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit + 1),
+);
+
+
+$failed = false;
+// test valid values
+for ($i = 0; $i < count($validNotEquals); $i +=2) {
+ $typeToTestVal = $validNotEquals[$i];
+ $compares = $validNotEquals[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal != $compareVal && $typeToTestVal <> $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' == '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test invalid values
+for ($i = 0; $i < count($invalidNotEquals); $i +=2) {
+ $typeToTestVal = $invalidNotEquals[$i];
+ $compares = $invalidNotEquals[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal != $compareVal || $typeToTestVal <> $compareVal) {
+ echo "FAILED: '$typeToTestVal' != '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_notidentical_basic.phpt b/tests/lang/operators/operator_notidentical_basic.phpt
new file mode 100644
index 0000000..d433289
--- /dev/null
+++ b/tests/lang/operators/operator_notidentical_basic.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test !== operator : different types
+--FILE--
+<?php
+
+$valid_true = array(1, "1", "true", 1.0, array(1));
+$valid_false = array(0, "", 0.0, array(), NULL);
+
+$int1 = 679;
+$int2 = -67835;
+$valid_int1 = array("679", "679abc", " 679", "679 ", 679.0, 6.79E2, "+679", "6 7 9", "6y79", 678);
+$valid_int2 = array("-67835", "-67835abc", " -67835", "-67835 ", -67835.000, -6.7835E4, "- 67835", "-67,835", "-67 835", "-678y35", -76834);
+$invalid_int1 = array(679, +679);
+$invalid_int2 = array(-67835);
+
+$float1 = 57385.45835;
+$float2 = -67345.76567;
+$valid_float1 = array("57385.45835", "57385.45835aaa", " 57385.45835", "57385. 45835", "57,385.45835", 57385.45834, 5.738545834e4);
+$valid_float2 = array("-67345.76567", "-67345.76567aaa", " -67345.76567", "- 67345.76567", "-67,345.76567", -67345.76566, -6.734576566E4);
+$invalid_float1 = array(57385.45835, 5.738545835e4);
+$invalid_float2 = array(-67345.76567, -6.734576567E4);
+
+
+$toCompare = array(
+ true, array_merge($valid_true, $valid_false), array(true),
+ false, array_merge($valid_true, $valid_false), array(false),
+ $int1, $valid_int1, $invalid_int1,
+ $int2, $valid_int2, $invalid_int2,
+ $float1, $valid_float1, $invalid_float1,
+ $float2, $valid_float2, $invalid_float2
+);
+
+$failed = false;
+for ($i = 0; $i < count($toCompare); $i +=3) {
+ $typeToTest = $toCompare[$i];
+ $valid_compares = $toCompare[$i + 1];
+ $invalid_compares = $toCompare[$i + 2];
+
+ foreach($valid_compares as $compareVal) {
+ if ($typeToTest !== $compareVal) {
+ // do nothing
+ }
+ else {
+ echo "FAILED: '$typeToTest' === '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+ foreach($invalid_compares as $compareVal) {
+ if ($typeToTest !== $compareVal) {
+ echo "FAILED: '$typeToTest' !== '$compareVal'\n";
+ $failed = true;
+ }
+ }
+
+}
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_notidentical_variation.phpt b/tests/lang/operators/operator_notidentical_variation.phpt
new file mode 100644
index 0000000..9af6f8d
--- /dev/null
+++ b/tests/lang/operators/operator_notidentical_variation.phpt
@@ -0,0 +1,64 @@
+--TEST--
+Test !== operator : max int 32bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$invalidNotIdentical = array (
+MAX_32Bit, array(MAX_32Bit),
+MIN_32Bit, array(MIN_32Bit),
+MAX_64Bit, array(MAX_64Bit, MAX_64Bit + 1, MAX_64Bit - 1),
+MIN_64Bit, array(MIN_64Bit, MIN_64Bit - 1, MIN_64Bit + 1),
+);
+
+$validNotIdentical = array (
+MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+);
+
+
+$failed = false;
+// test for valid values
+for ($i = 0; $i < count($validNotIdentical); $i +=2) {
+ $typeToTestVal = $validNotIdentical[$i];
+ $compares = $validNotIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal !== $compareVal) {
+ //Do Nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' === '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidNotIdentical); $i +=2) {
+ $typeToTestVal = $invalidNotIdentical[$i];
+ $compares = $invalidNotIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal !== $compareVal) {
+ echo "FAILED: '$typeToTestVal' !== '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/operator_notidentical_variation_64bit.phpt b/tests/lang/operators/operator_notidentical_variation_64bit.phpt
new file mode 100644
index 0000000..e8f2c7e
--- /dev/null
+++ b/tests/lang/operators/operator_notidentical_variation_64bit.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test !== operator : max int 64bit range
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$invalidNotIdentical = array (
+MAX_32Bit, array(MAX_32Bit),
+MIN_32Bit, array(MIN_32Bit),
+MAX_64Bit, array(MAX_64Bit),
+MIN_64Bit, array(MIN_64Bit),
+);
+
+$validNotIdentical = array (
+MAX_32Bit, array("2147483647", "2147483647.0000000", 2.147483647e9, 2147483647.0, "2147483648", 2.1474836470001e9, MAX_32Bit - 1, MAX_32Bit + 1),
+MIN_32Bit, array("-2147483648", "-2147483648.000", -2.147483648e9, -2147483648.0, "-2147483649", -2.1474836480001e9, MIN_32Bit -1, MIN_32Bit + 1),
+MAX_64Bit, array(MAX_64Bit - 1, MAX_64Bit + 1),
+MIN_64Bit, array(MIN_64Bit + 1, MIN_64Bit - 1),
+);
+
+
+$failed = false;
+// test for valid values
+for ($i = 0; $i < count($validNotIdentical); $i +=2) {
+ $typeToTestVal = $validNotIdentical[$i];
+ $compares = $validNotIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal !== $compareVal) {
+ //Do Nothing
+ }
+ else {
+ echo "FAILED: '$typeToTestVal' === '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+// test for invalid values
+for ($i = 0; $i < count($invalidNotIdentical); $i +=2) {
+ $typeToTestVal = $invalidNotIdentical[$i];
+ $compares = $invalidNotIdentical[$i + 1];
+ foreach($compares as $compareVal) {
+ if ($typeToTestVal !== $compareVal) {
+ echo "FAILED: '$typeToTestVal' !== '$compareVal'\n";
+ $failed = true;
+ }
+ }
+}
+
+if ($failed == false) {
+ echo "Test Passed\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+Test Passed
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/operators/postdec_basiclong_64bit.phpt b/tests/lang/operators/postdec_basiclong_64bit.phpt
new file mode 100644
index 0000000..9875df8
--- /dev/null
+++ b/tests/lang/operators/postdec_basiclong_64bit.phpt
@@ -0,0 +1,61 @@
+--TEST--
+Test N-- operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+
+foreach ($longVals as $longVal) {
+ echo "--- testing: $longVal ---\n";
+ $longVal--;
+ var_dump($longVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 ---
+int(9223372036854775806)
+--- testing: -9223372036854775808 ---
+float(-9.2233720368548E+18)
+--- testing: 2147483647 ---
+int(2147483646)
+--- testing: -2147483648 ---
+int(-2147483649)
+--- testing: 9223372034707292160 ---
+int(9223372034707292159)
+--- testing: -9223372034707292160 ---
+int(-9223372034707292161)
+--- testing: 2147483648 ---
+int(2147483647)
+--- testing: -2147483649 ---
+int(-2147483650)
+--- testing: 4294967294 ---
+int(4294967293)
+--- testing: 4294967295 ---
+int(4294967294)
+--- testing: 4294967293 ---
+int(4294967292)
+--- testing: 9223372036854775806 ---
+int(9223372036854775805)
+--- testing: 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+===DONE===
diff --git a/tests/lang/operators/postdec_variationStr.phpt b/tests/lang/operators/postdec_variationStr.phpt
new file mode 100644
index 0000000..ee5a8cd
--- /dev/null
+++ b/tests/lang/operators/postdec_variationStr.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Test N-- operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+
+foreach ($strVals as $strVal) {
+ echo "--- testing: '$strVal' ---\n";
+ $strVal--;
+ var_dump($strVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' ---
+int(-1)
+--- testing: '65' ---
+int(64)
+--- testing: '-44' ---
+int(-45)
+--- testing: '1.2' ---
+float(0.2)
+--- testing: '-7.7' ---
+float(-8.7)
+--- testing: 'abc' ---
+string(3) "abc"
+--- testing: '123abc' ---
+string(6) "123abc"
+--- testing: '123e5' ---
+float(12299999)
+--- testing: '123e5xyz' ---
+string(8) "123e5xyz"
+--- testing: ' 123abc' ---
+string(7) " 123abc"
+--- testing: '123 abc' ---
+string(7) "123 abc"
+--- testing: '123abc ' ---
+string(7) "123abc "
+--- testing: '3.4a' ---
+string(4) "3.4a"
+--- testing: 'a5.9' ---
+string(4) "a5.9"
+===DONE===
diff --git a/tests/lang/operators/postinc_basiclong_64bit.phpt b/tests/lang/operators/postinc_basiclong_64bit.phpt
new file mode 100644
index 0000000..494259a
--- /dev/null
+++ b/tests/lang/operators/postinc_basiclong_64bit.phpt
@@ -0,0 +1,61 @@
+--TEST--
+Test N++ operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+
+foreach ($longVals as $longVal) {
+ echo "--- testing: $longVal ---\n";
+ $longVal++;
+ var_dump($longVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775808 ---
+int(-9223372036854775807)
+--- testing: 2147483647 ---
+int(2147483648)
+--- testing: -2147483648 ---
+int(-2147483647)
+--- testing: 9223372034707292160 ---
+int(9223372034707292161)
+--- testing: -9223372034707292160 ---
+int(-9223372034707292159)
+--- testing: 2147483648 ---
+int(2147483649)
+--- testing: -2147483649 ---
+int(-2147483648)
+--- testing: 4294967294 ---
+int(4294967295)
+--- testing: 4294967295 ---
+int(4294967296)
+--- testing: 4294967293 ---
+int(4294967294)
+--- testing: 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775807 ---
+int(-9223372036854775806)
+--- testing: -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+===DONE===
diff --git a/tests/lang/operators/postinc_variationStr.phpt b/tests/lang/operators/postinc_variationStr.phpt
new file mode 100644
index 0000000..6fbe804
--- /dev/null
+++ b/tests/lang/operators/postinc_variationStr.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Test N++ operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+
+foreach ($strVals as $strVal) {
+ echo "--- testing: '$strVal' ---\n";
+ $strVal++;
+ var_dump($strVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' ---
+int(1)
+--- testing: '65' ---
+int(66)
+--- testing: '-44' ---
+int(-43)
+--- testing: '1.2' ---
+float(2.2)
+--- testing: '-7.7' ---
+float(-6.7)
+--- testing: 'abc' ---
+string(3) "abd"
+--- testing: '123abc' ---
+string(6) "123abd"
+--- testing: '123e5' ---
+float(12300001)
+--- testing: '123e5xyz' ---
+string(8) "123e5xza"
+--- testing: ' 123abc' ---
+string(7) " 123abd"
+--- testing: '123 abc' ---
+string(7) "123 abd"
+--- testing: '123abc ' ---
+string(7) "123abc "
+--- testing: '3.4a' ---
+string(4) "3.4b"
+--- testing: 'a5.9' ---
+string(4) "a5.0"
+===DONE===
diff --git a/tests/lang/operators/predec_basiclong_64bit.phpt b/tests/lang/operators/predec_basiclong_64bit.phpt
new file mode 100644
index 0000000..c1b15fd
--- /dev/null
+++ b/tests/lang/operators/predec_basiclong_64bit.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Test --N operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+
+foreach ($longVals as $longVal) {
+ echo "--- testing: $longVal ---\n";
+ var_dump(--$longVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 ---
+int(9223372036854775806)
+--- testing: -9223372036854775808 ---
+float(-9.2233720368548E+18)
+--- testing: 2147483647 ---
+int(2147483646)
+--- testing: -2147483648 ---
+int(-2147483649)
+--- testing: 9223372034707292160 ---
+int(9223372034707292159)
+--- testing: -9223372034707292160 ---
+int(-9223372034707292161)
+--- testing: 2147483648 ---
+int(2147483647)
+--- testing: -2147483649 ---
+int(-2147483650)
+--- testing: 4294967294 ---
+int(4294967293)
+--- testing: 4294967295 ---
+int(4294967294)
+--- testing: 4294967293 ---
+int(4294967292)
+--- testing: 9223372036854775806 ---
+int(9223372036854775805)
+--- testing: 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+===DONE===
diff --git a/tests/lang/operators/predec_variationStr.phpt b/tests/lang/operators/predec_variationStr.phpt
new file mode 100644
index 0000000..c7fb574
--- /dev/null
+++ b/tests/lang/operators/predec_variationStr.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Test --N operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+
+foreach ($strVals as $strVal) {
+ echo "--- testing: '$strVal' ---\n";
+ var_dump(--$strVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' ---
+int(-1)
+--- testing: '65' ---
+int(64)
+--- testing: '-44' ---
+int(-45)
+--- testing: '1.2' ---
+float(0.2)
+--- testing: '-7.7' ---
+float(-8.7)
+--- testing: 'abc' ---
+string(3) "abc"
+--- testing: '123abc' ---
+string(6) "123abc"
+--- testing: '123e5' ---
+float(12299999)
+--- testing: '123e5xyz' ---
+string(8) "123e5xyz"
+--- testing: ' 123abc' ---
+string(7) " 123abc"
+--- testing: '123 abc' ---
+string(7) "123 abc"
+--- testing: '123abc ' ---
+string(7) "123abc "
+--- testing: '3.4a' ---
+string(4) "3.4a"
+--- testing: 'a5.9' ---
+string(4) "a5.9"
+===DONE===
diff --git a/tests/lang/operators/preinc_basiclong_64bit.phpt b/tests/lang/operators/preinc_basiclong_64bit.phpt
new file mode 100644
index 0000000..599aa4e
--- /dev/null
+++ b/tests/lang/operators/preinc_basiclong_64bit.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Test ++N operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+
+foreach ($longVals as $longVal) {
+ echo "--- testing: $longVal ---\n";
+ var_dump(++$longVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775808 ---
+int(-9223372036854775807)
+--- testing: 2147483647 ---
+int(2147483648)
+--- testing: -2147483648 ---
+int(-2147483647)
+--- testing: 9223372034707292160 ---
+int(9223372034707292161)
+--- testing: -9223372034707292160 ---
+int(-9223372034707292159)
+--- testing: 2147483648 ---
+int(2147483649)
+--- testing: -2147483649 ---
+int(-2147483648)
+--- testing: 4294967294 ---
+int(4294967295)
+--- testing: 4294967295 ---
+int(4294967296)
+--- testing: 4294967293 ---
+int(4294967294)
+--- testing: 9223372036854775806 ---
+int(9223372036854775807)
+--- testing: 9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -9223372036854775807 ---
+int(-9223372036854775806)
+--- testing: -9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+===DONE===
diff --git a/tests/lang/operators/preinc_variationStr.phpt b/tests/lang/operators/preinc_variationStr.phpt
new file mode 100644
index 0000000..010a237
--- /dev/null
+++ b/tests/lang/operators/preinc_variationStr.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Test ++N operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+
+foreach ($strVals as $strVal) {
+ echo "--- testing: '$strVal' ---\n";
+ var_dump(++$strVal);
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' ---
+int(1)
+--- testing: '65' ---
+int(66)
+--- testing: '-44' ---
+int(-43)
+--- testing: '1.2' ---
+float(2.2)
+--- testing: '-7.7' ---
+float(-6.7)
+--- testing: 'abc' ---
+string(3) "abd"
+--- testing: '123abc' ---
+string(6) "123abd"
+--- testing: '123e5' ---
+float(12300001)
+--- testing: '123e5xyz' ---
+string(8) "123e5xza"
+--- testing: ' 123abc' ---
+string(7) " 123abd"
+--- testing: '123 abc' ---
+string(7) "123 abd"
+--- testing: '123abc ' ---
+string(7) "123abc "
+--- testing: '3.4a' ---
+string(4) "3.4b"
+--- testing: 'a5.9' ---
+string(4) "a5.0"
+===DONE===
diff --git a/tests/lang/operators/subtract_basiclong_64bit.phpt b/tests/lang/operators/subtract_basiclong_64bit.phpt
new file mode 100644
index 0000000..f52b951
--- /dev/null
+++ b/tests/lang/operators/subtract_basiclong_64bit.phpt
@@ -0,0 +1,582 @@
+--TEST--
+Test - operator : 64bit long tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+?>
+--FILE--
+<?php
+
+define("MAX_64Bit", 9223372036854775807);
+define("MAX_32Bit", 2147483647);
+define("MIN_64Bit", -9223372036854775807 - 1);
+define("MIN_32Bit", -2147483647 - 1);
+
+$longVals = array(
+ MAX_64Bit, MIN_64Bit, MAX_32Bit, MIN_32Bit, MAX_64Bit - MAX_32Bit, MIN_64Bit - MIN_32Bit,
+ MAX_32Bit + 1, MIN_32Bit - 1, MAX_32Bit * 2, (MAX_32Bit * 2) + 1, (MAX_32Bit * 2) - 1,
+ MAX_64Bit -1, MAX_64Bit + 1, MIN_64Bit + 1, MIN_64Bit - 1
+);
+
+$otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MAX_64Bit);
+
+error_reporting(E_ERROR);
+
+foreach ($longVals as $longVal) {
+ foreach($otherVals as $otherVal) {
+ echo "--- testing: $longVal - $otherVal ---\n";
+ var_dump($longVal-$otherVal);
+ }
+}
+
+foreach ($otherVals as $otherVal) {
+ foreach($longVals as $longVal) {
+ echo "--- testing: $otherVal - $longVal ---\n";
+ var_dump($otherVal-$longVal);
+ }
+}
+
+?>
+===DONE===
+--EXPECT--
+--- testing: 9223372036854775807 - 0 ---
+int(9223372036854775807)
+--- testing: 9223372036854775807 - 1 ---
+int(9223372036854775806)
+--- testing: 9223372036854775807 - -1 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775807 - 7 ---
+int(9223372036854775800)
+--- testing: 9223372036854775807 - 9 ---
+int(9223372036854775798)
+--- testing: 9223372036854775807 - 65 ---
+int(9223372036854775742)
+--- testing: 9223372036854775807 - -44 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775807 - 2147483647 ---
+int(9223372034707292160)
+--- testing: 9223372036854775807 - 9223372036854775807 ---
+int(0)
+--- testing: -9223372036854775808 - 0 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775808 - 1 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775808 - -1 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775808 - 7 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775808 - 9 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775808 - 65 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775808 - -44 ---
+int(-9223372036854775764)
+--- testing: -9223372036854775808 - 2147483647 ---
+float(-9.2233720390023E+18)
+--- testing: -9223372036854775808 - 9223372036854775807 ---
+float(-1.844674407371E+19)
+--- testing: 2147483647 - 0 ---
+int(2147483647)
+--- testing: 2147483647 - 1 ---
+int(2147483646)
+--- testing: 2147483647 - -1 ---
+int(2147483648)
+--- testing: 2147483647 - 7 ---
+int(2147483640)
+--- testing: 2147483647 - 9 ---
+int(2147483638)
+--- testing: 2147483647 - 65 ---
+int(2147483582)
+--- testing: 2147483647 - -44 ---
+int(2147483691)
+--- testing: 2147483647 - 2147483647 ---
+int(0)
+--- testing: 2147483647 - 9223372036854775807 ---
+int(-9223372034707292160)
+--- testing: -2147483648 - 0 ---
+int(-2147483648)
+--- testing: -2147483648 - 1 ---
+int(-2147483649)
+--- testing: -2147483648 - -1 ---
+int(-2147483647)
+--- testing: -2147483648 - 7 ---
+int(-2147483655)
+--- testing: -2147483648 - 9 ---
+int(-2147483657)
+--- testing: -2147483648 - 65 ---
+int(-2147483713)
+--- testing: -2147483648 - -44 ---
+int(-2147483604)
+--- testing: -2147483648 - 2147483647 ---
+int(-4294967295)
+--- testing: -2147483648 - 9223372036854775807 ---
+float(-9.2233720390023E+18)
+--- testing: 9223372034707292160 - 0 ---
+int(9223372034707292160)
+--- testing: 9223372034707292160 - 1 ---
+int(9223372034707292159)
+--- testing: 9223372034707292160 - -1 ---
+int(9223372034707292161)
+--- testing: 9223372034707292160 - 7 ---
+int(9223372034707292153)
+--- testing: 9223372034707292160 - 9 ---
+int(9223372034707292151)
+--- testing: 9223372034707292160 - 65 ---
+int(9223372034707292095)
+--- testing: 9223372034707292160 - -44 ---
+int(9223372034707292204)
+--- testing: 9223372034707292160 - 2147483647 ---
+int(9223372032559808513)
+--- testing: 9223372034707292160 - 9223372036854775807 ---
+int(-2147483647)
+--- testing: -9223372034707292160 - 0 ---
+int(-9223372034707292160)
+--- testing: -9223372034707292160 - 1 ---
+int(-9223372034707292161)
+--- testing: -9223372034707292160 - -1 ---
+int(-9223372034707292159)
+--- testing: -9223372034707292160 - 7 ---
+int(-9223372034707292167)
+--- testing: -9223372034707292160 - 9 ---
+int(-9223372034707292169)
+--- testing: -9223372034707292160 - 65 ---
+int(-9223372034707292225)
+--- testing: -9223372034707292160 - -44 ---
+int(-9223372034707292116)
+--- testing: -9223372034707292160 - 2147483647 ---
+int(-9223372036854775807)
+--- testing: -9223372034707292160 - 9223372036854775807 ---
+float(-1.8446744071562E+19)
+--- testing: 2147483648 - 0 ---
+int(2147483648)
+--- testing: 2147483648 - 1 ---
+int(2147483647)
+--- testing: 2147483648 - -1 ---
+int(2147483649)
+--- testing: 2147483648 - 7 ---
+int(2147483641)
+--- testing: 2147483648 - 9 ---
+int(2147483639)
+--- testing: 2147483648 - 65 ---
+int(2147483583)
+--- testing: 2147483648 - -44 ---
+int(2147483692)
+--- testing: 2147483648 - 2147483647 ---
+int(1)
+--- testing: 2147483648 - 9223372036854775807 ---
+int(-9223372034707292159)
+--- testing: -2147483649 - 0 ---
+int(-2147483649)
+--- testing: -2147483649 - 1 ---
+int(-2147483650)
+--- testing: -2147483649 - -1 ---
+int(-2147483648)
+--- testing: -2147483649 - 7 ---
+int(-2147483656)
+--- testing: -2147483649 - 9 ---
+int(-2147483658)
+--- testing: -2147483649 - 65 ---
+int(-2147483714)
+--- testing: -2147483649 - -44 ---
+int(-2147483605)
+--- testing: -2147483649 - 2147483647 ---
+int(-4294967296)
+--- testing: -2147483649 - 9223372036854775807 ---
+float(-9.2233720390023E+18)
+--- testing: 4294967294 - 0 ---
+int(4294967294)
+--- testing: 4294967294 - 1 ---
+int(4294967293)
+--- testing: 4294967294 - -1 ---
+int(4294967295)
+--- testing: 4294967294 - 7 ---
+int(4294967287)
+--- testing: 4294967294 - 9 ---
+int(4294967285)
+--- testing: 4294967294 - 65 ---
+int(4294967229)
+--- testing: 4294967294 - -44 ---
+int(4294967338)
+--- testing: 4294967294 - 2147483647 ---
+int(2147483647)
+--- testing: 4294967294 - 9223372036854775807 ---
+int(-9223372032559808513)
+--- testing: 4294967295 - 0 ---
+int(4294967295)
+--- testing: 4294967295 - 1 ---
+int(4294967294)
+--- testing: 4294967295 - -1 ---
+int(4294967296)
+--- testing: 4294967295 - 7 ---
+int(4294967288)
+--- testing: 4294967295 - 9 ---
+int(4294967286)
+--- testing: 4294967295 - 65 ---
+int(4294967230)
+--- testing: 4294967295 - -44 ---
+int(4294967339)
+--- testing: 4294967295 - 2147483647 ---
+int(2147483648)
+--- testing: 4294967295 - 9223372036854775807 ---
+int(-9223372032559808512)
+--- testing: 4294967293 - 0 ---
+int(4294967293)
+--- testing: 4294967293 - 1 ---
+int(4294967292)
+--- testing: 4294967293 - -1 ---
+int(4294967294)
+--- testing: 4294967293 - 7 ---
+int(4294967286)
+--- testing: 4294967293 - 9 ---
+int(4294967284)
+--- testing: 4294967293 - 65 ---
+int(4294967228)
+--- testing: 4294967293 - -44 ---
+int(4294967337)
+--- testing: 4294967293 - 2147483647 ---
+int(2147483646)
+--- testing: 4294967293 - 9223372036854775807 ---
+int(-9223372032559808514)
+--- testing: 9223372036854775806 - 0 ---
+int(9223372036854775806)
+--- testing: 9223372036854775806 - 1 ---
+int(9223372036854775805)
+--- testing: 9223372036854775806 - -1 ---
+int(9223372036854775807)
+--- testing: 9223372036854775806 - 7 ---
+int(9223372036854775799)
+--- testing: 9223372036854775806 - 9 ---
+int(9223372036854775797)
+--- testing: 9223372036854775806 - 65 ---
+int(9223372036854775741)
+--- testing: 9223372036854775806 - -44 ---
+float(9.2233720368548E+18)
+--- testing: 9223372036854775806 - 2147483647 ---
+int(9223372034707292159)
+--- testing: 9223372036854775806 - 9223372036854775807 ---
+int(-1)
+--- testing: 9.2233720368548E+18 - 0 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 - 1 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 - -1 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 - 7 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 - 9 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 - 65 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 - -44 ---
+float(9.2233720368548E+18)
+--- testing: 9.2233720368548E+18 - 2147483647 ---
+float(9.2233720347073E+18)
+--- testing: 9.2233720368548E+18 - 9223372036854775807 ---
+float(0)
+--- testing: -9223372036854775807 - 0 ---
+int(-9223372036854775807)
+--- testing: -9223372036854775807 - 1 ---
+int(-9223372036854775808)
+--- testing: -9223372036854775807 - -1 ---
+int(-9223372036854775806)
+--- testing: -9223372036854775807 - 7 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775807 - 9 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775807 - 65 ---
+float(-9.2233720368548E+18)
+--- testing: -9223372036854775807 - -44 ---
+int(-9223372036854775763)
+--- testing: -9223372036854775807 - 2147483647 ---
+float(-9.2233720390023E+18)
+--- testing: -9223372036854775807 - 9223372036854775807 ---
+float(-1.844674407371E+19)
+--- testing: -9.2233720368548E+18 - 0 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 - 1 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 - -1 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 - 7 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 - 9 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 - 65 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 - -44 ---
+float(-9.2233720368548E+18)
+--- testing: -9.2233720368548E+18 - 2147483647 ---
+float(-9.2233720390023E+18)
+--- testing: -9.2233720368548E+18 - 9223372036854775807 ---
+float(-1.844674407371E+19)
+--- testing: 0 - 9223372036854775807 ---
+int(-9223372036854775807)
+--- testing: 0 - -9223372036854775808 ---
+float(9.2233720368548E+18)
+--- testing: 0 - 2147483647 ---
+int(-2147483647)
+--- testing: 0 - -2147483648 ---
+int(2147483648)
+--- testing: 0 - 9223372034707292160 ---
+int(-9223372034707292160)
+--- testing: 0 - -9223372034707292160 ---
+int(9223372034707292160)
+--- testing: 0 - 2147483648 ---
+int(-2147483648)
+--- testing: 0 - -2147483649 ---
+int(2147483649)
+--- testing: 0 - 4294967294 ---
+int(-4294967294)
+--- testing: 0 - 4294967295 ---
+int(-4294967295)
+--- testing: 0 - 4294967293 ---
+int(-4294967293)
+--- testing: 0 - 9223372036854775806 ---
+int(-9223372036854775806)
+--- testing: 0 - 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 0 - -9223372036854775807 ---
+int(9223372036854775807)
+--- testing: 0 - -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 1 - 9223372036854775807 ---
+int(-9223372036854775806)
+--- testing: 1 - -9223372036854775808 ---
+float(9.2233720368548E+18)
+--- testing: 1 - 2147483647 ---
+int(-2147483646)
+--- testing: 1 - -2147483648 ---
+int(2147483649)
+--- testing: 1 - 9223372034707292160 ---
+int(-9223372034707292159)
+--- testing: 1 - -9223372034707292160 ---
+int(9223372034707292161)
+--- testing: 1 - 2147483648 ---
+int(-2147483647)
+--- testing: 1 - -2147483649 ---
+int(2147483650)
+--- testing: 1 - 4294967294 ---
+int(-4294967293)
+--- testing: 1 - 4294967295 ---
+int(-4294967294)
+--- testing: 1 - 4294967293 ---
+int(-4294967292)
+--- testing: 1 - 9223372036854775806 ---
+int(-9223372036854775805)
+--- testing: 1 - 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 1 - -9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 1 - -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -1 - 9223372036854775807 ---
+int(-9223372036854775808)
+--- testing: -1 - -9223372036854775808 ---
+int(9223372036854775807)
+--- testing: -1 - 2147483647 ---
+int(-2147483648)
+--- testing: -1 - -2147483648 ---
+int(2147483647)
+--- testing: -1 - 9223372034707292160 ---
+int(-9223372034707292161)
+--- testing: -1 - -9223372034707292160 ---
+int(9223372034707292159)
+--- testing: -1 - 2147483648 ---
+int(-2147483649)
+--- testing: -1 - -2147483649 ---
+int(2147483648)
+--- testing: -1 - 4294967294 ---
+int(-4294967295)
+--- testing: -1 - 4294967295 ---
+int(-4294967296)
+--- testing: -1 - 4294967293 ---
+int(-4294967294)
+--- testing: -1 - 9223372036854775806 ---
+int(-9223372036854775807)
+--- testing: -1 - 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: -1 - -9223372036854775807 ---
+int(9223372036854775806)
+--- testing: -1 - -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 7 - 9223372036854775807 ---
+int(-9223372036854775800)
+--- testing: 7 - -9223372036854775808 ---
+float(9.2233720368548E+18)
+--- testing: 7 - 2147483647 ---
+int(-2147483640)
+--- testing: 7 - -2147483648 ---
+int(2147483655)
+--- testing: 7 - 9223372034707292160 ---
+int(-9223372034707292153)
+--- testing: 7 - -9223372034707292160 ---
+int(9223372034707292167)
+--- testing: 7 - 2147483648 ---
+int(-2147483641)
+--- testing: 7 - -2147483649 ---
+int(2147483656)
+--- testing: 7 - 4294967294 ---
+int(-4294967287)
+--- testing: 7 - 4294967295 ---
+int(-4294967288)
+--- testing: 7 - 4294967293 ---
+int(-4294967286)
+--- testing: 7 - 9223372036854775806 ---
+int(-9223372036854775799)
+--- testing: 7 - 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 7 - -9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 7 - -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 9 - 9223372036854775807 ---
+int(-9223372036854775798)
+--- testing: 9 - -9223372036854775808 ---
+float(9.2233720368548E+18)
+--- testing: 9 - 2147483647 ---
+int(-2147483638)
+--- testing: 9 - -2147483648 ---
+int(2147483657)
+--- testing: 9 - 9223372034707292160 ---
+int(-9223372034707292151)
+--- testing: 9 - -9223372034707292160 ---
+int(9223372034707292169)
+--- testing: 9 - 2147483648 ---
+int(-2147483639)
+--- testing: 9 - -2147483649 ---
+int(2147483658)
+--- testing: 9 - 4294967294 ---
+int(-4294967285)
+--- testing: 9 - 4294967295 ---
+int(-4294967286)
+--- testing: 9 - 4294967293 ---
+int(-4294967284)
+--- testing: 9 - 9223372036854775806 ---
+int(-9223372036854775797)
+--- testing: 9 - 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 9 - -9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 9 - -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 65 - 9223372036854775807 ---
+int(-9223372036854775742)
+--- testing: 65 - -9223372036854775808 ---
+float(9.2233720368548E+18)
+--- testing: 65 - 2147483647 ---
+int(-2147483582)
+--- testing: 65 - -2147483648 ---
+int(2147483713)
+--- testing: 65 - 9223372034707292160 ---
+int(-9223372034707292095)
+--- testing: 65 - -9223372034707292160 ---
+int(9223372034707292225)
+--- testing: 65 - 2147483648 ---
+int(-2147483583)
+--- testing: 65 - -2147483649 ---
+int(2147483714)
+--- testing: 65 - 4294967294 ---
+int(-4294967229)
+--- testing: 65 - 4294967295 ---
+int(-4294967230)
+--- testing: 65 - 4294967293 ---
+int(-4294967228)
+--- testing: 65 - 9223372036854775806 ---
+int(-9223372036854775741)
+--- testing: 65 - 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: 65 - -9223372036854775807 ---
+float(9.2233720368548E+18)
+--- testing: 65 - -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: -44 - 9223372036854775807 ---
+float(-9.2233720368548E+18)
+--- testing: -44 - -9223372036854775808 ---
+int(9223372036854775764)
+--- testing: -44 - 2147483647 ---
+int(-2147483691)
+--- testing: -44 - -2147483648 ---
+int(2147483604)
+--- testing: -44 - 9223372034707292160 ---
+int(-9223372034707292204)
+--- testing: -44 - -9223372034707292160 ---
+int(9223372034707292116)
+--- testing: -44 - 2147483648 ---
+int(-2147483692)
+--- testing: -44 - -2147483649 ---
+int(2147483605)
+--- testing: -44 - 4294967294 ---
+int(-4294967338)
+--- testing: -44 - 4294967295 ---
+int(-4294967339)
+--- testing: -44 - 4294967293 ---
+int(-4294967337)
+--- testing: -44 - 9223372036854775806 ---
+float(-9.2233720368548E+18)
+--- testing: -44 - 9.2233720368548E+18 ---
+float(-9.2233720368548E+18)
+--- testing: -44 - -9223372036854775807 ---
+int(9223372036854775763)
+--- testing: -44 - -9.2233720368548E+18 ---
+float(9.2233720368548E+18)
+--- testing: 2147483647 - 9223372036854775807 ---
+int(-9223372034707292160)
+--- testing: 2147483647 - -9223372036854775808 ---
+float(9.2233720390023E+18)
+--- testing: 2147483647 - 2147483647 ---
+int(0)
+--- testing: 2147483647 - -2147483648 ---
+int(4294967295)
+--- testing: 2147483647 - 9223372034707292160 ---
+int(-9223372032559808513)
+--- testing: 2147483647 - -9223372034707292160 ---
+int(9223372036854775807)
+--- testing: 2147483647 - 2147483648 ---
+int(-1)
+--- testing: 2147483647 - -2147483649 ---
+int(4294967296)
+--- testing: 2147483647 - 4294967294 ---
+int(-2147483647)
+--- testing: 2147483647 - 4294967295 ---
+int(-2147483648)
+--- testing: 2147483647 - 4294967293 ---
+int(-2147483646)
+--- testing: 2147483647 - 9223372036854775806 ---
+int(-9223372034707292159)
+--- testing: 2147483647 - 9.2233720368548E+18 ---
+float(-9.2233720347073E+18)
+--- testing: 2147483647 - -9223372036854775807 ---
+float(9.2233720390023E+18)
+--- testing: 2147483647 - -9.2233720368548E+18 ---
+float(9.2233720390023E+18)
+--- testing: 9223372036854775807 - 9223372036854775807 ---
+int(0)
+--- testing: 9223372036854775807 - -9223372036854775808 ---
+float(1.844674407371E+19)
+--- testing: 9223372036854775807 - 2147483647 ---
+int(9223372034707292160)
+--- testing: 9223372036854775807 - -2147483648 ---
+float(9.2233720390023E+18)
+--- testing: 9223372036854775807 - 9223372034707292160 ---
+int(2147483647)
+--- testing: 9223372036854775807 - -9223372034707292160 ---
+float(1.8446744071562E+19)
+--- testing: 9223372036854775807 - 2147483648 ---
+int(9223372034707292159)
+--- testing: 9223372036854775807 - -2147483649 ---
+float(9.2233720390023E+18)
+--- testing: 9223372036854775807 - 4294967294 ---
+int(9223372032559808513)
+--- testing: 9223372036854775807 - 4294967295 ---
+int(9223372032559808512)
+--- testing: 9223372036854775807 - 4294967293 ---
+int(9223372032559808514)
+--- testing: 9223372036854775807 - 9223372036854775806 ---
+int(1)
+--- testing: 9223372036854775807 - 9.2233720368548E+18 ---
+float(0)
+--- testing: 9223372036854775807 - -9223372036854775807 ---
+float(1.844674407371E+19)
+--- testing: 9223372036854775807 - -9.2233720368548E+18 ---
+float(1.844674407371E+19)
+===DONE===
diff --git a/tests/lang/operators/subtract_variationStr.phpt b/tests/lang/operators/subtract_variationStr.phpt
new file mode 100644
index 0000000..5b5bae2
--- /dev/null
+++ b/tests/lang/operators/subtract_variationStr.phpt
@@ -0,0 +1,416 @@
+--TEST--
+Test - operator : various numbers as strings
+--FILE--
+<?php
+
+$strVals = array(
+ "0","65","-44", "1.2", "-7.7", "abc", "123abc", "123e5", "123e5xyz", " 123abc", "123 abc", "123abc ", "3.4a",
+ "a5.9"
+);
+
+error_reporting(E_ERROR);
+
+foreach ($strVals as $strVal) {
+ foreach($strVals as $otherVal) {
+ echo "--- testing: '$strVal' - '$otherVal' ---\n";
+ var_dump($strVal-$otherVal);
+ }
+}
+
+
+?>
+===DONE===
+--EXPECT--
+--- testing: '0' - '0' ---
+int(0)
+--- testing: '0' - '65' ---
+int(-65)
+--- testing: '0' - '-44' ---
+int(44)
+--- testing: '0' - '1.2' ---
+float(-1.2)
+--- testing: '0' - '-7.7' ---
+float(7.7)
+--- testing: '0' - 'abc' ---
+int(0)
+--- testing: '0' - '123abc' ---
+int(-123)
+--- testing: '0' - '123e5' ---
+float(-12300000)
+--- testing: '0' - '123e5xyz' ---
+float(-12300000)
+--- testing: '0' - ' 123abc' ---
+int(-123)
+--- testing: '0' - '123 abc' ---
+int(-123)
+--- testing: '0' - '123abc ' ---
+int(-123)
+--- testing: '0' - '3.4a' ---
+float(-3.4)
+--- testing: '0' - 'a5.9' ---
+int(0)
+--- testing: '65' - '0' ---
+int(65)
+--- testing: '65' - '65' ---
+int(0)
+--- testing: '65' - '-44' ---
+int(109)
+--- testing: '65' - '1.2' ---
+float(63.8)
+--- testing: '65' - '-7.7' ---
+float(72.7)
+--- testing: '65' - 'abc' ---
+int(65)
+--- testing: '65' - '123abc' ---
+int(-58)
+--- testing: '65' - '123e5' ---
+float(-12299935)
+--- testing: '65' - '123e5xyz' ---
+float(-12299935)
+--- testing: '65' - ' 123abc' ---
+int(-58)
+--- testing: '65' - '123 abc' ---
+int(-58)
+--- testing: '65' - '123abc ' ---
+int(-58)
+--- testing: '65' - '3.4a' ---
+float(61.6)
+--- testing: '65' - 'a5.9' ---
+int(65)
+--- testing: '-44' - '0' ---
+int(-44)
+--- testing: '-44' - '65' ---
+int(-109)
+--- testing: '-44' - '-44' ---
+int(0)
+--- testing: '-44' - '1.2' ---
+float(-45.2)
+--- testing: '-44' - '-7.7' ---
+float(-36.3)
+--- testing: '-44' - 'abc' ---
+int(-44)
+--- testing: '-44' - '123abc' ---
+int(-167)
+--- testing: '-44' - '123e5' ---
+float(-12300044)
+--- testing: '-44' - '123e5xyz' ---
+float(-12300044)
+--- testing: '-44' - ' 123abc' ---
+int(-167)
+--- testing: '-44' - '123 abc' ---
+int(-167)
+--- testing: '-44' - '123abc ' ---
+int(-167)
+--- testing: '-44' - '3.4a' ---
+float(-47.4)
+--- testing: '-44' - 'a5.9' ---
+int(-44)
+--- testing: '1.2' - '0' ---
+float(1.2)
+--- testing: '1.2' - '65' ---
+float(-63.8)
+--- testing: '1.2' - '-44' ---
+float(45.2)
+--- testing: '1.2' - '1.2' ---
+float(0)
+--- testing: '1.2' - '-7.7' ---
+float(8.9)
+--- testing: '1.2' - 'abc' ---
+float(1.2)
+--- testing: '1.2' - '123abc' ---
+float(-121.8)
+--- testing: '1.2' - '123e5' ---
+float(-12299998.8)
+--- testing: '1.2' - '123e5xyz' ---
+float(-12299998.8)
+--- testing: '1.2' - ' 123abc' ---
+float(-121.8)
+--- testing: '1.2' - '123 abc' ---
+float(-121.8)
+--- testing: '1.2' - '123abc ' ---
+float(-121.8)
+--- testing: '1.2' - '3.4a' ---
+float(-2.2)
+--- testing: '1.2' - 'a5.9' ---
+float(1.2)
+--- testing: '-7.7' - '0' ---
+float(-7.7)
+--- testing: '-7.7' - '65' ---
+float(-72.7)
+--- testing: '-7.7' - '-44' ---
+float(36.3)
+--- testing: '-7.7' - '1.2' ---
+float(-8.9)
+--- testing: '-7.7' - '-7.7' ---
+float(0)
+--- testing: '-7.7' - 'abc' ---
+float(-7.7)
+--- testing: '-7.7' - '123abc' ---
+float(-130.7)
+--- testing: '-7.7' - '123e5' ---
+float(-12300007.7)
+--- testing: '-7.7' - '123e5xyz' ---
+float(-12300007.7)
+--- testing: '-7.7' - ' 123abc' ---
+float(-130.7)
+--- testing: '-7.7' - '123 abc' ---
+float(-130.7)
+--- testing: '-7.7' - '123abc ' ---
+float(-130.7)
+--- testing: '-7.7' - '3.4a' ---
+float(-11.1)
+--- testing: '-7.7' - 'a5.9' ---
+float(-7.7)
+--- testing: 'abc' - '0' ---
+int(0)
+--- testing: 'abc' - '65' ---
+int(-65)
+--- testing: 'abc' - '-44' ---
+int(44)
+--- testing: 'abc' - '1.2' ---
+float(-1.2)
+--- testing: 'abc' - '-7.7' ---
+float(7.7)
+--- testing: 'abc' - 'abc' ---
+int(0)
+--- testing: 'abc' - '123abc' ---
+int(-123)
+--- testing: 'abc' - '123e5' ---
+float(-12300000)
+--- testing: 'abc' - '123e5xyz' ---
+float(-12300000)
+--- testing: 'abc' - ' 123abc' ---
+int(-123)
+--- testing: 'abc' - '123 abc' ---
+int(-123)
+--- testing: 'abc' - '123abc ' ---
+int(-123)
+--- testing: 'abc' - '3.4a' ---
+float(-3.4)
+--- testing: 'abc' - 'a5.9' ---
+int(0)
+--- testing: '123abc' - '0' ---
+int(123)
+--- testing: '123abc' - '65' ---
+int(58)
+--- testing: '123abc' - '-44' ---
+int(167)
+--- testing: '123abc' - '1.2' ---
+float(121.8)
+--- testing: '123abc' - '-7.7' ---
+float(130.7)
+--- testing: '123abc' - 'abc' ---
+int(123)
+--- testing: '123abc' - '123abc' ---
+int(0)
+--- testing: '123abc' - '123e5' ---
+float(-12299877)
+--- testing: '123abc' - '123e5xyz' ---
+float(-12299877)
+--- testing: '123abc' - ' 123abc' ---
+int(0)
+--- testing: '123abc' - '123 abc' ---
+int(0)
+--- testing: '123abc' - '123abc ' ---
+int(0)
+--- testing: '123abc' - '3.4a' ---
+float(119.6)
+--- testing: '123abc' - 'a5.9' ---
+int(123)
+--- testing: '123e5' - '0' ---
+float(12300000)
+--- testing: '123e5' - '65' ---
+float(12299935)
+--- testing: '123e5' - '-44' ---
+float(12300044)
+--- testing: '123e5' - '1.2' ---
+float(12299998.8)
+--- testing: '123e5' - '-7.7' ---
+float(12300007.7)
+--- testing: '123e5' - 'abc' ---
+float(12300000)
+--- testing: '123e5' - '123abc' ---
+float(12299877)
+--- testing: '123e5' - '123e5' ---
+float(0)
+--- testing: '123e5' - '123e5xyz' ---
+float(0)
+--- testing: '123e5' - ' 123abc' ---
+float(12299877)
+--- testing: '123e5' - '123 abc' ---
+float(12299877)
+--- testing: '123e5' - '123abc ' ---
+float(12299877)
+--- testing: '123e5' - '3.4a' ---
+float(12299996.6)
+--- testing: '123e5' - 'a5.9' ---
+float(12300000)
+--- testing: '123e5xyz' - '0' ---
+float(12300000)
+--- testing: '123e5xyz' - '65' ---
+float(12299935)
+--- testing: '123e5xyz' - '-44' ---
+float(12300044)
+--- testing: '123e5xyz' - '1.2' ---
+float(12299998.8)
+--- testing: '123e5xyz' - '-7.7' ---
+float(12300007.7)
+--- testing: '123e5xyz' - 'abc' ---
+float(12300000)
+--- testing: '123e5xyz' - '123abc' ---
+float(12299877)
+--- testing: '123e5xyz' - '123e5' ---
+float(0)
+--- testing: '123e5xyz' - '123e5xyz' ---
+float(0)
+--- testing: '123e5xyz' - ' 123abc' ---
+float(12299877)
+--- testing: '123e5xyz' - '123 abc' ---
+float(12299877)
+--- testing: '123e5xyz' - '123abc ' ---
+float(12299877)
+--- testing: '123e5xyz' - '3.4a' ---
+float(12299996.6)
+--- testing: '123e5xyz' - 'a5.9' ---
+float(12300000)
+--- testing: ' 123abc' - '0' ---
+int(123)
+--- testing: ' 123abc' - '65' ---
+int(58)
+--- testing: ' 123abc' - '-44' ---
+int(167)
+--- testing: ' 123abc' - '1.2' ---
+float(121.8)
+--- testing: ' 123abc' - '-7.7' ---
+float(130.7)
+--- testing: ' 123abc' - 'abc' ---
+int(123)
+--- testing: ' 123abc' - '123abc' ---
+int(0)
+--- testing: ' 123abc' - '123e5' ---
+float(-12299877)
+--- testing: ' 123abc' - '123e5xyz' ---
+float(-12299877)
+--- testing: ' 123abc' - ' 123abc' ---
+int(0)
+--- testing: ' 123abc' - '123 abc' ---
+int(0)
+--- testing: ' 123abc' - '123abc ' ---
+int(0)
+--- testing: ' 123abc' - '3.4a' ---
+float(119.6)
+--- testing: ' 123abc' - 'a5.9' ---
+int(123)
+--- testing: '123 abc' - '0' ---
+int(123)
+--- testing: '123 abc' - '65' ---
+int(58)
+--- testing: '123 abc' - '-44' ---
+int(167)
+--- testing: '123 abc' - '1.2' ---
+float(121.8)
+--- testing: '123 abc' - '-7.7' ---
+float(130.7)
+--- testing: '123 abc' - 'abc' ---
+int(123)
+--- testing: '123 abc' - '123abc' ---
+int(0)
+--- testing: '123 abc' - '123e5' ---
+float(-12299877)
+--- testing: '123 abc' - '123e5xyz' ---
+float(-12299877)
+--- testing: '123 abc' - ' 123abc' ---
+int(0)
+--- testing: '123 abc' - '123 abc' ---
+int(0)
+--- testing: '123 abc' - '123abc ' ---
+int(0)
+--- testing: '123 abc' - '3.4a' ---
+float(119.6)
+--- testing: '123 abc' - 'a5.9' ---
+int(123)
+--- testing: '123abc ' - '0' ---
+int(123)
+--- testing: '123abc ' - '65' ---
+int(58)
+--- testing: '123abc ' - '-44' ---
+int(167)
+--- testing: '123abc ' - '1.2' ---
+float(121.8)
+--- testing: '123abc ' - '-7.7' ---
+float(130.7)
+--- testing: '123abc ' - 'abc' ---
+int(123)
+--- testing: '123abc ' - '123abc' ---
+int(0)
+--- testing: '123abc ' - '123e5' ---
+float(-12299877)
+--- testing: '123abc ' - '123e5xyz' ---
+float(-12299877)
+--- testing: '123abc ' - ' 123abc' ---
+int(0)
+--- testing: '123abc ' - '123 abc' ---
+int(0)
+--- testing: '123abc ' - '123abc ' ---
+int(0)
+--- testing: '123abc ' - '3.4a' ---
+float(119.6)
+--- testing: '123abc ' - 'a5.9' ---
+int(123)
+--- testing: '3.4a' - '0' ---
+float(3.4)
+--- testing: '3.4a' - '65' ---
+float(-61.6)
+--- testing: '3.4a' - '-44' ---
+float(47.4)
+--- testing: '3.4a' - '1.2' ---
+float(2.2)
+--- testing: '3.4a' - '-7.7' ---
+float(11.1)
+--- testing: '3.4a' - 'abc' ---
+float(3.4)
+--- testing: '3.4a' - '123abc' ---
+float(-119.6)
+--- testing: '3.4a' - '123e5' ---
+float(-12299996.6)
+--- testing: '3.4a' - '123e5xyz' ---
+float(-12299996.6)
+--- testing: '3.4a' - ' 123abc' ---
+float(-119.6)
+--- testing: '3.4a' - '123 abc' ---
+float(-119.6)
+--- testing: '3.4a' - '123abc ' ---
+float(-119.6)
+--- testing: '3.4a' - '3.4a' ---
+float(0)
+--- testing: '3.4a' - 'a5.9' ---
+float(3.4)
+--- testing: 'a5.9' - '0' ---
+int(0)
+--- testing: 'a5.9' - '65' ---
+int(-65)
+--- testing: 'a5.9' - '-44' ---
+int(44)
+--- testing: 'a5.9' - '1.2' ---
+float(-1.2)
+--- testing: 'a5.9' - '-7.7' ---
+float(7.7)
+--- testing: 'a5.9' - 'abc' ---
+int(0)
+--- testing: 'a5.9' - '123abc' ---
+int(-123)
+--- testing: 'a5.9' - '123e5' ---
+float(-12300000)
+--- testing: 'a5.9' - '123e5xyz' ---
+float(-12300000)
+--- testing: 'a5.9' - ' 123abc' ---
+int(-123)
+--- testing: 'a5.9' - '123 abc' ---
+int(-123)
+--- testing: 'a5.9' - '123abc ' ---
+int(-123)
+--- testing: 'a5.9' - '3.4a' ---
+float(-3.4)
+--- testing: 'a5.9' - 'a5.9' ---
+int(0)
+===DONE===
diff --git a/tests/lang/passByReference_001.phpt b/tests/lang/passByReference_001.phpt
new file mode 100644
index 0000000..c73eacc
--- /dev/null
+++ b/tests/lang/passByReference_001.phpt
@@ -0,0 +1,37 @@
+--TEST--
+passing of function parameters by reference
+--FILE--
+<?php
+function f($arg1, &$arg2)
+{
+ var_dump($arg1++);
+ var_dump($arg2++);
+}
+
+function g (&$arg1, &$arg2)
+{
+ var_dump($arg1);
+ var_dump($arg2);
+}
+$a = 7;
+$b = 15;
+
+f($a, $b);
+
+var_dump($a);
+var_dump($b);
+
+$c=array(1);
+g($c,$c[0]);
+
+?>
+--EXPECT--
+int(7)
+int(15)
+int(7)
+int(16)
+array(1) {
+ [0]=>
+ &int(1)
+}
+int(1) \ No newline at end of file
diff --git a/tests/lang/passByReference_002.phpt b/tests/lang/passByReference_002.phpt
new file mode 100644
index 0000000..d1968a3
--- /dev/null
+++ b/tests/lang/passByReference_002.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Attempt to pass a constant by reference
+--FILE--
+<?php
+
+function f(&$arg1)
+{
+ var_dump($arg1++);
+}
+
+f(2);
+
+?>
+--EXPECTF--
+Fatal error: Only variables can be passed by reference in %s on line 8
diff --git a/tests/lang/passByReference_003.phpt b/tests/lang/passByReference_003.phpt
new file mode 100644
index 0000000..bbbc564
--- /dev/null
+++ b/tests/lang/passByReference_003.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Implicit initialisation when passing by reference
+--FILE--
+<?php
+function passbyVal($val) {
+ echo "\nInside passbyVal call:\n";
+ var_dump($val);
+}
+
+function passbyRef(&$ref) {
+ echo "\nInside passbyRef call:\n";
+ var_dump($ref);
+}
+
+echo "\nPassing undefined by value\n";
+passbyVal($undef1[0]);
+echo "\nAfter call\n";
+var_dump($undef1);
+
+echo "\nPassing undefined by reference\n";
+passbyRef($undef2[0]);
+echo "\nAfter call\n";
+var_dump($undef2)
+?>
+--EXPECTF--
+
+Passing undefined by value
+
+Notice: Undefined variable: undef1 in %s on line 13
+
+Inside passbyVal call:
+NULL
+
+After call
+
+Notice: Undefined variable: undef1 in %s on line 15
+NULL
+
+Passing undefined by reference
+
+Inside passbyRef call:
+NULL
+
+After call
+array(1) {
+ [0]=>
+ NULL
+}
diff --git a/tests/lang/passByReference_004.phpt b/tests/lang/passByReference_004.phpt
new file mode 100644
index 0000000..e8a7963
--- /dev/null
+++ b/tests/lang/passByReference_004.phpt
@@ -0,0 +1,21 @@
+--TEST--
+passing the return value from a function by reference
+--FILE--
+<?php
+
+function foo(&$ref)
+{
+ var_dump($ref);
+}
+
+function bar($value)
+{
+ return $value;
+}
+
+foo(bar(5));
+
+?>
+--EXPECTF--
+Strict Standards: Only variables should be passed by reference in %s on line 13
+int(5)
diff --git a/tests/lang/passByReference_005.phpt b/tests/lang/passByReference_005.phpt
new file mode 100644
index 0000000..52ddeeb
--- /dev/null
+++ b/tests/lang/passByReference_005.phpt
@@ -0,0 +1,261 @@
+--TEST--
+Pass uninitialised variables by reference and by value to test implicit initialisation.
+--FILE--
+<?php
+
+function v($val) {
+ $val = "Val changed";
+}
+
+function r(&$ref) {
+ $ref = "Ref changed";
+}
+
+
+function vv($val1, $val2) {
+ $val1 = "Val1 changed";
+ $val2 = "Val2 changed";
+}
+
+function vr($val, &$ref) {
+ $val = "Val changed";
+ $ref = "Ref changed";
+}
+
+function rv(&$ref, $val) {
+ $val = "Val changed";
+ $ref = "Ref changed";
+}
+
+function rr(&$ref1, &$ref2) {
+ $ref1 = "Ref1 changed";
+ $ref2 = "Ref2 changed";
+}
+
+
+class C {
+
+ function __construct($val, &$ref) {
+ $val = "Val changed";
+ $ref = "Ref changed";
+ }
+
+ function v($val) {
+ $val = "Val changed";
+ }
+
+ function r(&$ref) {
+ $ref = "Ref changed";
+ }
+
+ function vv($val1, $val2) {
+ $val1 = "Val1 changed";
+ $val2 = "Val2 changed";
+ }
+
+ function vr($val, &$ref) {
+ $val = "Val changed";
+ $ref = "Ref changed";
+ }
+
+ function rv(&$ref, $val) {
+ $val = "Val changed";
+ $ref = "Ref changed";
+ }
+
+ function rr(&$ref1, &$ref2) {
+ $ref1 = "Ref1 changed";
+ $ref2 = "Ref2 changed";
+ }
+
+}
+
+echo "\n ---- Pass by ref / pass by val: functions ----\n";
+unset($u1, $u2);
+v($u1);
+r($u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+vv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+vr($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+rv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+rr($u1, $u2);
+var_dump($u1, $u2);
+
+
+echo "\n\n ---- Pass by ref / pass by val: static method calls ----\n";
+unset($u1, $u2);
+C::v($u1);
+C::r($u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::vv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::vr($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::rv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::rr($u1, $u2);
+var_dump($u1, $u2);
+
+echo "\n\n ---- Pass by ref / pass by val: instance method calls ----\n";
+unset($u1, $u2);
+$c = new C($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->v($u1);
+$c->r($u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->vv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->vr($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->rv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->rr($u1, $u2);
+var_dump($u1, $u2);
+
+?>
+--EXPECTF--
+
+ ---- Pass by ref / pass by val: functions ----
+
+Notice: Undefined variable: u1 in %s on line 72
+
+Notice: Undefined variable: u1 in %s on line 74
+NULL
+string(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line 77
+
+Notice: Undefined variable: u2 in %s on line 77
+
+Notice: Undefined variable: u1 in %s on line 78
+
+Notice: Undefined variable: u2 in %s on line 78
+NULL
+NULL
+
+Notice: Undefined variable: u1 in %s on line 81
+
+Notice: Undefined variable: u1 in %s on line 82
+NULL
+string(11) "Ref changed"
+
+Notice: Undefined variable: u2 in %s on line 85
+
+Notice: Undefined variable: u2 in %s on line 86
+string(11) "Ref changed"
+NULL
+string(12) "Ref1 changed"
+string(12) "Ref2 changed"
+
+
+ ---- Pass by ref / pass by val: static method calls ----
+
+Notice: Undefined variable: u1 in %s on line 95
+
+Strict Standards: Non-static method C::v() should not be called statically in %s on line 95
+
+Strict Standards: Non-static method C::r() should not be called statically in %s on line 96
+
+Notice: Undefined variable: u1 in %s on line 97
+NULL
+string(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line 100
+
+Notice: Undefined variable: u2 in %s on line 100
+
+Strict Standards: Non-static method C::vv() should not be called statically in %s on line 100
+
+Notice: Undefined variable: u1 in %s on line 101
+
+Notice: Undefined variable: u2 in %s on line 101
+NULL
+NULL
+
+Notice: Undefined variable: u1 in %s on line 104
+
+Strict Standards: Non-static method C::vr() should not be called statically in %s on line 104
+
+Notice: Undefined variable: u1 in %s on line 105
+NULL
+string(11) "Ref changed"
+
+Notice: Undefined variable: u2 in %s on line 108
+
+Strict Standards: Non-static method C::rv() should not be called statically in %s on line 108
+
+Notice: Undefined variable: u2 in %s on line 109
+string(11) "Ref changed"
+NULL
+
+Strict Standards: Non-static method C::rr() should not be called statically in %s on line 112
+string(12) "Ref1 changed"
+string(12) "Ref2 changed"
+
+
+ ---- Pass by ref / pass by val: instance method calls ----
+
+Notice: Undefined variable: u1 in %s on line 117
+
+Notice: Undefined variable: u1 in %s on line 118
+NULL
+string(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line 121
+
+Notice: Undefined variable: u1 in %s on line 123
+NULL
+string(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line 126
+
+Notice: Undefined variable: u2 in %s on line 126
+
+Notice: Undefined variable: u1 in %s on line 127
+
+Notice: Undefined variable: u2 in %s on line 127
+NULL
+NULL
+
+Notice: Undefined variable: u1 in %s on line 130
+
+Notice: Undefined variable: u1 in %s on line 131
+NULL
+string(11) "Ref changed"
+
+Notice: Undefined variable: u2 in %s on line 134
+
+Notice: Undefined variable: u2 in %s on line 135
+string(11) "Ref changed"
+NULL
+string(12) "Ref1 changed"
+string(12) "Ref2 changed" \ No newline at end of file
diff --git a/tests/lang/passByReference_006.phpt b/tests/lang/passByReference_006.phpt
new file mode 100644
index 0000000..248be88
--- /dev/null
+++ b/tests/lang/passByReference_006.phpt
@@ -0,0 +1,195 @@
+--TEST--
+Pass uninitialised objects and arrays by reference to test implicit initialisation.
+--FILE--
+<?php
+
+function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+ $ref1 = "Ref1 changed";
+ $ref2 = "Ref2 changed";
+ $ref3 = "Ref3 changed";
+ $ref4 = "Ref4 changed";
+ $ref5 = "Ref5 changed";
+}
+
+
+class C {
+
+ function __construct(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+ $ref1 = "Ref1 changed";
+ $ref2 = "Ref2 changed";
+ $ref3 = "Ref3 changed";
+ $ref4 = "Ref4 changed";
+ $ref5 = "Ref5 changed";
+ }
+
+ function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+ $ref1 = "Ref1 changed";
+ $ref2 = "Ref2 changed";
+ $ref3 = "Ref3 changed";
+ $ref4 = "Ref4 changed";
+ $ref5 = "Ref5 changed";
+ }
+
+}
+
+echo "\n ---- Pass uninitialised array & object by ref: function call ---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+echo "\n ---- Pass uninitialised arrays & objects by ref: static method call ---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+C::refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+echo "\n\n---- Pass uninitialised arrays & objects by ref: constructor ---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+$c = new C($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+echo "\n ---- Pass uninitialised arrays & objects by ref: instance method call ---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+$c->refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+?>
+--EXPECTF--
+
+ ---- Pass uninitialised array & object by ref: function call ---
+array(1) {
+ [0]=>
+ string(12) "Ref1 changed"
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [1]=>
+ string(12) "Ref2 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ string(12) "Ref3 changed"
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ string(12) "Ref4 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ object(stdClass)#%d (1) {
+ ["c"]=>
+ string(12) "Ref5 changed"
+ }
+ }
+}
+
+ ---- Pass uninitialised arrays & objects by ref: static method call ---
+
+Strict Standards: Non-static method C::refs() should not be called statically in %s on line 39
+array(1) {
+ [0]=>
+ string(12) "Ref1 changed"
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [1]=>
+ string(12) "Ref2 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ string(12) "Ref3 changed"
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ string(12) "Ref4 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ object(stdClass)#%d (1) {
+ ["c"]=>
+ string(12) "Ref5 changed"
+ }
+ }
+}
+
+
+---- Pass uninitialised arrays & objects by ref: constructor ---
+array(1) {
+ [0]=>
+ string(12) "Ref1 changed"
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [1]=>
+ string(12) "Ref2 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ string(12) "Ref3 changed"
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ string(12) "Ref4 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ object(stdClass)#%d (1) {
+ ["c"]=>
+ string(12) "Ref5 changed"
+ }
+ }
+}
+
+ ---- Pass uninitialised arrays & objects by ref: instance method call ---
+array(1) {
+ [0]=>
+ string(12) "Ref1 changed"
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [1]=>
+ string(12) "Ref2 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ string(12) "Ref3 changed"
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ string(12) "Ref4 changed"
+ }
+}
+object(stdClass)#%d (1) {
+ ["a"]=>
+ object(stdClass)#%d (1) {
+ ["b"]=>
+ object(stdClass)#%d (1) {
+ ["c"]=>
+ string(12) "Ref5 changed"
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/lang/passByReference_007.phpt b/tests/lang/passByReference_007.phpt
new file mode 100644
index 0000000..558ceae
--- /dev/null
+++ b/tests/lang/passByReference_007.phpt
@@ -0,0 +1,105 @@
+--TEST--
+Pass function and method calls by reference and by value.
+--FILE--
+<?php
+class C {
+ static function sreturnVal() {
+ global $a;
+ return $a;
+ }
+
+ static function &sreturnReference() {
+ global $a;
+ return $a;
+ }
+
+ function returnVal() {
+ global $a;
+ return $a;
+ }
+
+ function &returnReference() {
+ global $a;
+ return $a;
+ }
+}
+
+function returnVal() {
+ global $a;
+ return $a;
+}
+
+function &returnReference() {
+ global $a;
+ return $a;
+}
+
+
+
+function foo(&$ref) {
+ var_dump($ref);
+ $ref = "changed";
+}
+
+
+echo "Pass a function call that returns a value:\n";
+$a = "original";
+foo(returnVal());
+var_dump($a);
+
+echo "Pass a function call that returns a reference:\n";
+$a = "original";
+foo(returnReference());
+var_dump($a);
+
+
+echo "\nPass a static method call that returns a value:\n";
+$a = "original";
+foo(C::sreturnVal());
+var_dump($a);
+
+echo "Pass a static method call that returns a reference:\n";
+$a = "original";
+foo(C::sreturnReference());
+var_dump($a);
+
+
+$myC = new C;
+echo "\nPass a method call that returns a value:\n";
+$a = "original";
+foo($myC->returnVal());
+var_dump($a);
+
+echo "Pass a method call that returns a reference:\n";
+$a = "original";
+foo($myC->returnReference());
+var_dump($a);
+
+?>
+--EXPECTF--
+Pass a function call that returns a value:
+
+Strict Standards: Only variables should be passed by reference in %s on line 44
+string(8) "original"
+string(8) "original"
+Pass a function call that returns a reference:
+string(8) "original"
+string(7) "changed"
+
+Pass a static method call that returns a value:
+
+Strict Standards: Only variables should be passed by reference in %s on line 55
+string(8) "original"
+string(8) "original"
+Pass a static method call that returns a reference:
+string(8) "original"
+string(7) "changed"
+
+Pass a method call that returns a value:
+
+Strict Standards: Only variables should be passed by reference in %s on line 67
+string(8) "original"
+string(8) "original"
+Pass a method call that returns a reference:
+string(8) "original"
+string(7) "changed" \ No newline at end of file
diff --git a/tests/lang/passByReference_008.phpt b/tests/lang/passByReference_008.phpt
new file mode 100644
index 0000000..3685217
--- /dev/null
+++ b/tests/lang/passByReference_008.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Pass same variable by ref and by value.
+--FILE--
+<?php
+function valRef($x, &$y) {
+ var_dump($x, $y);
+ $x = 'changed.x';
+ $y = 'changed.y';
+}
+
+function refVal(&$x, $y) {
+ var_dump($x, $y);
+ $x = 'changed.x';
+ $y = 'changed.y';
+}
+
+
+echo "\n\n-- Val, Ref --\n";
+$a = 'original.a';
+valRef($a, $a);
+var_dump($a);
+
+echo "\n\n-- Ref, Val --\n";
+$b = 'original.b';
+refVal($b, $b);
+var_dump($b);
+?>
+--EXPECTF--
+
+
+-- Val, Ref --
+string(10) "original.a"
+string(10) "original.a"
+string(9) "changed.y"
+
+
+-- Ref, Val --
+string(10) "original.b"
+string(10) "original.b"
+string(9) "changed.x" \ No newline at end of file
diff --git a/tests/lang/passByReference_009.phpt b/tests/lang/passByReference_009.phpt
new file mode 100644
index 0000000..1cbd87d
--- /dev/null
+++ b/tests/lang/passByReference_009.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Assignement as argument
+--FILE--
+<?php
+ function foo(&$x, &$y) { $x = 1; echo $y ; }
+
+ $x = 0;
+ foo($x, $x); // prints 1 ..
+
+
+ function foo2($x, &$y, $z)
+ {
+ echo $x; // 0
+ echo $y; // 1
+ $y = 2;
+ }
+
+ $x = 0;
+
+ foo2($x, $x, $x = 1);
+ echo $x; // 2
+?>
+--EXPECTF--
+1012 \ No newline at end of file
diff --git a/tests/lang/passByReference_010.phpt b/tests/lang/passByReference_010.phpt
new file mode 100644
index 0000000..0393cce
--- /dev/null
+++ b/tests/lang/passByReference_010.phpt
@@ -0,0 +1,61 @@
+--TEST--
+Passing assignments by reference
+--FILE--
+<?php
+
+function f(&$a) {
+ var_dump($a);
+ $a = "a.changed";
+}
+
+echo "\n\n---> Pass constant assignment by reference:\n";
+f($a="a.original");
+var_dump($a);
+
+echo "\n\n---> Pass variable assignment by reference:\n";
+unset($a);
+$a = "a.original";
+f($b = $a);
+var_dump($a);
+
+echo "\n\n---> Pass reference assignment by reference:\n";
+unset($a, $b);
+$a = "a.original";
+f($b =& $a);
+var_dump($a);
+
+echo "\n\n---> Pass concat assignment by reference:\n";
+unset($a, $b);
+$b = "b.original";
+$a = "a.original";
+f($b .= $a);
+var_dump($a);
+
+?>
+--EXPECTF--
+
+
+---> Pass constant assignment by reference:
+
+Strict Standards: Only variables should be passed by reference in %s on line 9
+string(10) "a.original"
+string(10) "a.original"
+
+
+---> Pass variable assignment by reference:
+
+Strict Standards: Only variables should be passed by reference in %s on line 15
+string(10) "a.original"
+string(10) "a.original"
+
+
+---> Pass reference assignment by reference:
+string(10) "a.original"
+string(9) "a.changed"
+
+
+---> Pass concat assignment by reference:
+
+Strict Standards: Only variables should be passed by reference in %s on line 28
+string(20) "b.originala.original"
+string(10) "a.original"
diff --git a/tests/lang/passByReference_012.phpt b/tests/lang/passByReference_012.phpt
new file mode 100644
index 0000000..c6ce705
--- /dev/null
+++ b/tests/lang/passByReference_012.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Test pass by reference semantics
+--FILE--
+<?php
+error_reporting(E_ALL | E_STRICT | E_NOTICE);
+
+// Simplified array_shift_variation5.phpt
+// Showing warning:
+// "Only variables should be passed by reference in %s on line %d"
+$stack = array ( array ( 'two' ));
+var_dump(array_shift(array_shift($stack)));
+
+// This should show the identical warning
+$original = array ( array ( 'one' ));
+$stack = $original;
+var_dump(array_shift(array_shift($stack)));
+?>
+===DONE===
+--EXPECTF--
+Strict Standards: Only variables should be passed by reference in %s on line %d
+string(3) "two"
+
+Strict Standards: Only variables should be passed by reference in %s on line %d
+string(3) "one"
+===DONE===
diff --git a/tests/lang/returnByReference.001.phpt b/tests/lang/returnByReference.001.phpt
new file mode 100644
index 0000000..4abc3c7
--- /dev/null
+++ b/tests/lang/returnByReference.001.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Returning a reference from a function
+--FILE--
+<?php
+
+function &returnByRef(&$arg1)
+{
+ return $arg1;
+}
+
+$a = 7;
+$b =& returnByRef($a);
+var_dump($b);
+$a++;
+var_dump($b);
+
+?>
+--EXPECT--
+int(7)
+int(8) \ No newline at end of file
diff --git a/tests/lang/returnByReference.002.phpt b/tests/lang/returnByReference.002.phpt
new file mode 100644
index 0000000..3494eb5
--- /dev/null
+++ b/tests/lang/returnByReference.002.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Returning a reference from a function.
+--FILE--
+<?php
+function &returnRef() {
+ global $a;
+ return $a;
+}
+
+function returnVal() {
+ global $a;
+ return $a;
+}
+
+$a = "original";
+$b =& returnVal();
+$b = "changed";
+var_dump($a); //expecting warning + "original"
+
+$a = "original";
+$b =& returnRef();
+$b = "changed";
+var_dump($a); //expecting "changed"
+?>
+--EXPECTF--
+
+Strict Standards: Only variables should be assigned by reference in %s on line 13
+string(8) "original"
+string(7) "changed"
diff --git a/tests/lang/returnByReference.003.phpt b/tests/lang/returnByReference.003.phpt
new file mode 100644
index 0000000..04a6338
--- /dev/null
+++ b/tests/lang/returnByReference.003.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Returning a reference from a function
+--FILE--
+<?php
+function returnConstantByValue() {
+ return 100;
+}
+
+function &returnConstantByRef() {
+ return 100;
+}
+
+function &returnVariableByRef() {
+ return $GLOBALS['a'];
+}
+
+echo "\n---> 1. Trying to assign by reference the return value of a function that returns by value:\n";
+unset($a, $b);
+$a = 4;
+$b = &returnConstantByValue();
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &returnConstantByRef();
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &returnVariableByRef();
+$a++;
+var_dump($a, $b);
+
+?>
+--EXPECTF--
+
+---> 1. Trying to assign by reference the return value of a function that returns by value:
+
+Strict Standards: Only variables should be assigned by reference in %s on line 17
+int(5)
+int(100)
+
+---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:
+
+Notice: Only variable references should be returned by reference in %s on line 7
+int(5)
+int(100)
+
+---> 3. Trying to assign by reference the return value of a function that returns by ref:
+int(5)
+int(5)
diff --git a/tests/lang/returnByReference.004.phpt b/tests/lang/returnByReference.004.phpt
new file mode 100644
index 0000000..f185c12
--- /dev/null
+++ b/tests/lang/returnByReference.004.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Returning a reference from a static method
+--FILE--
+<?php
+Class C {
+ static function returnConstantByValue() {
+ return 100;
+ }
+
+ static function &returnConstantByRef() {
+ return 100;
+ }
+
+ static function &returnVariableByRef() {
+ return $GLOBALS['a'];
+ }
+}
+
+echo "\n---> 1. Trying to assign by reference the return value of a function that returns by value:\n";
+unset($a, $b);
+$a = 4;
+$b = &C::returnConstantByValue();
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &C::returnConstantByRef();
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &C::returnVariableByRef();
+$a++;
+var_dump($a, $b);
+
+?>
+--EXPECTF--
+
+---> 1. Trying to assign by reference the return value of a function that returns by value:
+
+Strict Standards: Only variables should be assigned by reference in %s on line 19
+int(5)
+int(100)
+
+---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:
+
+Notice: Only variable references should be returned by reference in %s on line 8
+int(5)
+int(100)
+
+---> 3. Trying to assign by reference the return value of a function that returns by ref:
+int(5)
+int(5)
diff --git a/tests/lang/returnByReference.005.phpt b/tests/lang/returnByReference.005.phpt
new file mode 100644
index 0000000..a7b6da2
--- /dev/null
+++ b/tests/lang/returnByReference.005.phpt
@@ -0,0 +1,58 @@
+--TEST--
+Returning a reference from a method
+--FILE--
+<?php
+Class C {
+ function returnConstantByValue() {
+ return 100;
+ }
+
+ function &returnConstantByRef() {
+ return 100;
+ }
+
+ static function &returnVariableByRef() {
+ return $GLOBALS['a'];
+ }
+}
+$c = new C;
+
+echo "\n---> 1. Trying to assign by reference the return value of a function that returns by value:\n";
+unset($a, $b);
+$a = 4;
+$b = &$c->returnConstantByValue();
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &$c->returnConstantByRef();
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 3. Trying to assign by reference the return value of a function that returns by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &$c->returnVariableByRef();
+$a++;
+var_dump($a, $b);
+
+?>
+--EXPECTF--
+
+---> 1. Trying to assign by reference the return value of a function that returns by value:
+
+Strict Standards: Only variables should be assigned by reference in %s on line 20
+int(5)
+int(100)
+
+---> 2. Trying to assign by reference the return value of a function that returns a constant by ref:
+
+Notice: Only variable references should be returned by reference in %s on line 8
+int(5)
+int(100)
+
+---> 3. Trying to assign by reference the return value of a function that returns by ref:
+int(5)
+int(5)
diff --git a/tests/lang/returnByReference.006.phpt b/tests/lang/returnByReference.006.phpt
new file mode 100644
index 0000000..4019f3a
--- /dev/null
+++ b/tests/lang/returnByReference.006.phpt
@@ -0,0 +1,60 @@
+--TEST--
+Returning a reference from a function via another function
+--INI--
+error_reporting = E_ALL & ~E_STRICT
+--FILE--
+<?php
+function returnConstantByValue() {
+ return 100;
+}
+
+function &returnConstantByRef() {
+ return 100;
+}
+
+function &returnVariableByRef() {
+ return $GLOBALS['a'];
+}
+
+function &returnFunctionCallByRef($functionToCall) {
+ return $functionToCall();
+}
+
+echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n";
+unset($a, $b);
+$a = 4;
+$b = &returnFunctionCallByRef('returnConstantByValue');
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &returnFunctionCallByRef('returnConstantByRef');
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &returnFunctionCallByRef('returnVariableByRef');
+$a++;
+var_dump($a, $b);
+
+?>
+--EXPECTF--
+---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:
+
+Notice: Only variable references should be returned by reference in %s on line 15
+int(5)
+int(100)
+
+---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:
+
+Notice: Only variable references should be returned by reference in %s on line 7
+int(5)
+int(100)
+
+---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:
+int(5)
+int(5)
diff --git a/tests/lang/returnByReference.007.phpt b/tests/lang/returnByReference.007.phpt
new file mode 100644
index 0000000..1247e55
--- /dev/null
+++ b/tests/lang/returnByReference.007.phpt
@@ -0,0 +1,63 @@
+--TEST--
+Returning a reference from a static method via another static method
+--INI--
+error_reporting = E_ALL & ~E_STRICT
+--FILE--
+<?php
+class C {
+ static function returnConstantByValue() {
+ return 100;
+ }
+
+ static function &returnConstantByRef() {
+ return 100;
+ }
+
+ static function &returnVariableByRef() {
+ return $GLOBALS['a'];
+ }
+
+ static function &returnFunctionCallByRef($functionToCall) {
+ return C::$functionToCall();
+ }
+}
+
+echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n";
+unset($a, $b);
+$a = 4;
+$b = &C::returnFunctionCallByRef('returnConstantByValue');
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &C::returnFunctionCallByRef('returnConstantByRef');
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &C::returnFunctionCallByRef('returnVariableByRef');
+$a++;
+var_dump($a, $b);
+
+?>
+--EXPECTF--
+
+---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:
+
+Notice: Only variable references should be returned by reference in %s on line 16
+int(5)
+int(100)
+
+---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:
+
+Notice: Only variable references should be returned by reference in %s on line 8
+int(5)
+int(100)
+
+---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:
+int(5)
+int(5) \ No newline at end of file
diff --git a/tests/lang/returnByReference.008.phpt b/tests/lang/returnByReference.008.phpt
new file mode 100644
index 0000000..d595de2
--- /dev/null
+++ b/tests/lang/returnByReference.008.phpt
@@ -0,0 +1,64 @@
+--TEST--
+Returning a reference from a non-static method via another non-static method
+--INI--
+error_reporting = E_ALL & ~E_STRICT
+--FILE--
+<?php
+class C {
+ function returnConstantByValue() {
+ return 100;
+ }
+
+ function &returnConstantByRef() {
+ return 100;
+ }
+
+ function &returnVariableByRef() {
+ return $GLOBALS['a'];
+ }
+
+ function &returnFunctionCallByRef($functionToCall) {
+ return $this->$functionToCall();
+ }
+}
+$c = new C;
+
+echo "\n---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:\n";
+unset($a, $b);
+$a = 4;
+$b = &$c->returnFunctionCallByRef('returnConstantByValue');
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &$c->returnFunctionCallByRef('returnConstantByRef');
+$a++;
+var_dump($a, $b);
+
+echo "\n---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:\n";
+unset($a, $b);
+$a = 4;
+$b = &$c->returnFunctionCallByRef('returnVariableByRef');
+$a++;
+var_dump($a, $b);
+
+?>
+--EXPECTF--
+
+---> 1. Via a return by ref function call, assign by reference the return value of a function that returns by value:
+
+Notice: Only variable references should be returned by reference in %s on line 16
+int(5)
+int(100)
+
+---> 2. Via a return by ref function call, assign by reference the return value of a function that returns a constant by ref:
+
+Notice: Only variable references should be returned by reference in %s on line 8
+int(5)
+int(100)
+
+---> 3. Via a return by ref function call, assign by reference the return value of a function that returns by ref:
+int(5)
+int(5) \ No newline at end of file
diff --git a/tests/lang/returnByReference.009.phpt b/tests/lang/returnByReference.009.phpt
new file mode 100644
index 0000000..6320375
--- /dev/null
+++ b/tests/lang/returnByReference.009.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Returning a references returned by another function
+--FILE--
+<?php
+
+
+function &returnVarByRef () {
+ $b=1;
+ return $b;
+}
+
+function &testReturnVarByRef() {
+ return returnVarByRef();
+}
+
+function returnVal () {
+return 1;
+}
+
+function &testReturnValByRef() {
+ return returnVal();
+}
+
+echo "\n---> 1. Return a variable by reference -> No warning:\n";
+
+var_dump (testReturnVarByRef());
+
+echo "\n---> 2. Return a value by reference -> Warning:\n";
+
+var_dump (testReturnValByRef());
+
+--EXPECTF--
+---> 1. Return a variable by reference -> No warning:
+int(1)
+
+---> 2. Return a value by reference -> Warning:
+
+Notice: Only variable references should be returned by reference in %s on line %d
+int(1)
diff --git a/tests/lang/script_tag.phpt b/tests/lang/script_tag.phpt
new file mode 100644
index 0000000..1b5c696
--- /dev/null
+++ b/tests/lang/script_tag.phpt
@@ -0,0 +1,17 @@
+--TEST--
+<script> tag
+--FILE--
+<script language=php> echo "ola\n";</script>
+<script language="php"> echo "ola2\n";</script>
+<script language='php'> echo "ola3\n";</script>
+texto <sc <s <script> <script language> <script language=>
+<script language=php>
+#comment
+echo "oi\n"; //ignore here
+# 2nd comment
+--EXPECT--
+ola
+ola2
+ola3
+texto <sc <s <script> <script language> <script language=>
+oi
diff --git a/tests/lang/short_tags.001.phpt b/tests/lang/short_tags.001.phpt
new file mode 100644
index 0000000..522018e
--- /dev/null
+++ b/tests/lang/short_tags.001.phpt
@@ -0,0 +1,12 @@
+--TEST--
+short_open_tag: On
+--INI--
+short_open_tag=on
+--FILE--
+<?
+echo "Used a short tag\n";
+?>
+Finished
+--EXPECT--
+Used a short tag
+Finished
diff --git a/tests/lang/short_tags.002.phpt b/tests/lang/short_tags.002.phpt
new file mode 100644
index 0000000..6a3d5e0
--- /dev/null
+++ b/tests/lang/short_tags.002.phpt
@@ -0,0 +1,14 @@
+--TEST--
+short_open_tag: Off
+--INI--
+short_open_tag=off
+--FILE--
+<?
+echo "Used a short tag\n";
+?>
+Finished
+--EXPECT--
+<?
+echo "Used a short tag\n";
+?>
+Finished
diff --git a/tests/lang/short_tags.003.phpt b/tests/lang/short_tags.003.phpt
new file mode 100644
index 0000000..8894bf5
--- /dev/null
+++ b/tests/lang/short_tags.003.phpt
@@ -0,0 +1,32 @@
+--TEST--
+short_open_tag: On, asp_tags: On
+--INI--
+short_open_tag=on
+asp_tags=on
+--FILE--
+<?='this should get echoed'?>
+
+<%= 'so should this' %>
+
+<?php
+$a = 'This gets echoed twice';
+?>
+
+<?= $a?>
+
+<%= $a%>
+
+<? $b=3; ?>
+
+<?php
+ echo "{$b}";
+?>
+--EXPECT--
+this should get echoed
+so should this
+
+This gets echoed twice
+This gets echoed twice
+
+3
+
diff --git a/tests/lang/short_tags.004.phpt b/tests/lang/short_tags.004.phpt
new file mode 100644
index 0000000..ff33087
--- /dev/null
+++ b/tests/lang/short_tags.004.phpt
@@ -0,0 +1,35 @@
+--TEST--
+short_open_tag: Off, asp_tags: Off
+--INI--
+short_open_tag=off
+asp_tags=off
+--FILE--
+<%= 'so should this' %>
+
+<?php
+$a = 'This gets echoed twice';
+?>
+
+<?= $a?>
+
+<%= $a%>
+
+<? $b=3; ?>
+
+<?php
+ echo "{$b}";
+?>
+<?= "{$b}"?>
+--EXPECTF--
+<%= 'so should this' %>
+
+
+This gets echoed twice
+<%= $a%>
+
+<? $b=3; ?>
+
+
+Notice: Undefined variable: b in %s on line %d
+
+Notice: Undefined variable: b in %s on line %d
diff --git a/tests/lang/static_basic_001.phpt b/tests/lang/static_basic_001.phpt
new file mode 100644
index 0000000..45fc1b2
--- /dev/null
+++ b/tests/lang/static_basic_001.phpt
@@ -0,0 +1,84 @@
+--TEST--
+Static keyword - basic tests
+--FILE--
+<?php
+
+echo "\nSame variable used as static and non static.\n";
+function staticNonStatic() {
+ echo "---------\n";
+ $a=0;
+ echo "$a\n";
+ static $a=10;
+ echo "$a\n";
+ $a++;
+}
+staticNonStatic();
+staticNonStatic();
+staticNonStatic();
+
+echo "\nLots of initialisations in the same statement.\n";
+function manyInits() {
+ static $counter=0;
+ echo "------------- Call $counter --------------\n";
+ static $a, $b=10, $c=20, $d, $e=30;
+ echo "Unitialised : $a\n";
+ echo "Initialised to 10: $b\n";
+ echo "Initialised to 20: $c\n";
+ echo "Unitialised : $d\n";
+ echo "Initialised to 30: $e\n";
+ $a++;
+ $b++;
+ $c++;
+ $d++;
+ $e++;
+ $counter++;
+}
+manyInits();
+manyInits();
+manyInits();
+
+echo "\nUsing static keyword at global scope\n";
+for ($i=0; $i<3; $i++) {
+ static $s, $k=10;
+ echo "$s $k\n";
+ $s++;
+ $k++;
+}
+?>
+--EXPECT--
+
+Same variable used as static and non static.
+---------
+0
+10
+---------
+0
+11
+---------
+0
+12
+
+Lots of initialisations in the same statement.
+------------- Call 0 --------------
+Unitialised :
+Initialised to 10: 10
+Initialised to 20: 20
+Unitialised :
+Initialised to 30: 30
+------------- Call 1 --------------
+Unitialised : 1
+Initialised to 10: 11
+Initialised to 20: 21
+Unitialised : 1
+Initialised to 30: 31
+------------- Call 2 --------------
+Unitialised : 2
+Initialised to 10: 12
+Initialised to 20: 22
+Unitialised : 2
+Initialised to 30: 32
+
+Using static keyword at global scope
+ 10
+1 11
+2 12 \ No newline at end of file
diff --git a/tests/lang/static_basic_002.phpt b/tests/lang/static_basic_002.phpt
new file mode 100644
index 0000000..06e2f72
--- /dev/null
+++ b/tests/lang/static_basic_002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Multiple declarations of the same static variable
+--FILE--
+<?php
+
+$a = 5;
+
+var_dump($a);
+
+static $a = 10;
+static $a = 11;
+
+var_dump($a);
+
+function foo() {
+ static $a = 13;
+ static $a = 14;
+
+ var_dump($a);
+}
+
+foo();
+
+?>
+--EXPECT--
+int(5)
+int(11)
+int(14)
diff --git a/tests/lang/static_variation_001.phpt b/tests/lang/static_variation_001.phpt
new file mode 100644
index 0000000..a27b9fa
--- /dev/null
+++ b/tests/lang/static_variation_001.phpt
@@ -0,0 +1,112 @@
+--TEST--
+Statics in nested functions & evals.
+--FILE--
+<?php
+
+static $a = array(7,8,9);
+
+function f1() {
+ static $a = array(1,2,3);
+
+ function g1() {
+ static $a = array(4,5,6);
+ var_dump($a);
+ }
+
+ var_dump($a);
+
+}
+
+f1();
+g1();
+var_dump($a);
+
+eval(' static $b = array(10,11,12); ');
+
+function f2() {
+ eval(' static $b = array(1,2,3); ');
+
+ function g2a() {
+ eval(' static $b = array(4,5,6); ');
+ var_dump($b);
+ }
+
+ eval('function g2b() { static $b = array(7, 8, 9); var_dump($b); } ');
+ var_dump($b);
+}
+
+f2();
+g2a();
+g2b();
+var_dump($b);
+
+
+eval(' function f3() { static $c = array(1,2,3); var_dump($c); }');
+f3();
+
+?>
+--EXPECTF--
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(4)
+ [1]=>
+ int(5)
+ [2]=>
+ int(6)
+}
+array(3) {
+ [0]=>
+ int(7)
+ [1]=>
+ int(8)
+ [2]=>
+ int(9)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(4)
+ [1]=>
+ int(5)
+ [2]=>
+ int(6)
+}
+array(3) {
+ [0]=>
+ int(7)
+ [1]=>
+ int(8)
+ [2]=>
+ int(9)
+}
+array(3) {
+ [0]=>
+ int(10)
+ [1]=>
+ int(11)
+ [2]=>
+ int(12)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+} \ No newline at end of file
diff --git a/tests/lang/static_variation_002.phpt b/tests/lang/static_variation_002.phpt
new file mode 100644
index 0000000..b8933fd
--- /dev/null
+++ b/tests/lang/static_variation_002.phpt
@@ -0,0 +1,84 @@
+--TEST--
+Static variables in methods & nested functions & evals.
+--FILE--
+<?php
+
+Class C {
+ function f() {
+ static $a = array(1,2,3);
+ eval(' static $k = array(4,5,6); ');
+
+ function cfg() {
+ static $a = array(7,8,9);
+ eval(' static $k = array(10,11,12); ');
+ var_dump($a, $k);
+ }
+ var_dump($a, $k);
+ }
+}
+$c = new C;
+$c->f();
+cfg();
+
+Class D {
+ static function f() {
+ eval('function dfg() { static $b = array(1,2,3); var_dump($b); } ');
+ }
+}
+D::f();
+dfg();
+
+eval(' Class E { function f() { static $c = array(1,2,3); var_dump($c); } }');
+$e = new E;
+$e->f();
+
+?>
+--EXPECTF--
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(4)
+ [1]=>
+ int(5)
+ [2]=>
+ int(6)
+}
+array(3) {
+ [0]=>
+ int(7)
+ [1]=>
+ int(8)
+ [2]=>
+ int(9)
+}
+array(3) {
+ [0]=>
+ int(10)
+ [1]=>
+ int(11)
+ [2]=>
+ int(12)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+}
+array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+} \ No newline at end of file
diff --git a/tests/lang/string_decimals_001.phpt b/tests/lang/string_decimals_001.phpt
new file mode 100644
index 0000000..3a509b2
--- /dev/null
+++ b/tests/lang/string_decimals_001.phpt
@@ -0,0 +1,45 @@
+--TEST--
+String conversion with multiple decimal points
+--FILE--
+<?php
+function test($str) {
+ echo "\n--> Testing $str:\n";
+ var_dump((int)$str);
+ var_dump((float)$str);
+ var_dump($str > 0);
+}
+
+test("..9");
+test(".9.");
+test("9..");
+test("9.9.");
+test("9.9.9");
+?>
+===DONE===
+--EXPECTF--
+
+--> Testing ..9:
+int(0)
+float(0)
+bool(false)
+
+--> Testing .9.:
+int(0)
+float(0.9)
+bool(true)
+
+--> Testing 9..:
+int(9)
+float(9)
+bool(true)
+
+--> Testing 9.9.:
+int(9)
+float(9.9)
+bool(true)
+
+--> Testing 9.9.9:
+int(9)
+float(9.9)
+bool(true)
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/this_assignment.phpt b/tests/lang/this_assignment.phpt
new file mode 100644
index 0000000..7158a34
--- /dev/null
+++ b/tests/lang/this_assignment.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Test to catch early assignment of $this
+--FILE--
+<?php
+class first {
+
+ function me() { echo "first"; }
+
+ function who() {
+ global $a,$b;
+ $this->me();
+ $a->me();
+ $b->me();
+ $b = new second();
+ $this->me();
+ $a->me();
+ $b->me();
+ }
+}
+
+class second {
+
+ function who() {
+ global $a,$b;
+ $this->me();
+ $a->me();
+ $b->me();
+ }
+ function me() { echo "second"; }
+}
+
+$a = new first();
+$b = &$a;
+
+$a->who();
+$b->who();
+
+echo "\n";
+?>
+===DONE===
+--EXPECT--
+firstfirstfirstfirstsecondsecondsecondsecondsecond
+===DONE=== \ No newline at end of file
diff --git a/tests/lang/throw_variation_001.phpt b/tests/lang/throw_variation_001.phpt
new file mode 100644
index 0000000..d942a87
--- /dev/null
+++ b/tests/lang/throw_variation_001.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Catching an exception thrown from an included file
+--FILE--
+<?php
+
+try {
+ include "inc_throw.inc";
+} catch (Exception $e) {
+ echo "caught exception\n";
+}
+
+?>
+--EXPECT--
+caught exception
diff --git a/tests/lang/type_hints_001.phpt b/tests/lang/type_hints_001.phpt
new file mode 100644
index 0000000..57808d4
--- /dev/null
+++ b/tests/lang/type_hints_001.phpt
@@ -0,0 +1,26 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class Foo {
+}
+
+class Bar {
+}
+
+function type_hint_foo(Foo $a) {
+}
+
+$foo = new Foo;
+$bar = new Bar;
+
+type_hint_foo($foo);
+type_hint_foo($bar);
+
+?>
+--EXPECTF--
+
+Catchable fatal error: Argument 1 passed to type_hint_foo() must be an instance of Foo, instance of Bar given, called in %s on line 16 and defined in %s on line 9
diff --git a/tests/lang/type_hints_002.phpt b/tests/lang/type_hints_002.phpt
new file mode 100644
index 0000000..b21240a
--- /dev/null
+++ b/tests/lang/type_hints_002.phpt
@@ -0,0 +1,28 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class P { }
+class T {
+ function f(P $p = NULL) {
+ var_dump($p);
+ echo "-\n";
+ }
+}
+
+$o=new T();
+$o->f(new P);
+$o->f();
+$o->f(NULL);
+?>
+--EXPECT--
+object(P)#2 (0) {
+}
+-
+NULL
+-
+NULL
+-
+
diff --git a/tests/lang/type_hints_003.phpt b/tests/lang/type_hints_003.phpt
new file mode 100644
index 0000000..0ef3e35
--- /dev/null
+++ b/tests/lang/type_hints_003.phpt
@@ -0,0 +1,14 @@
+--TEST--
+ZE2 type hinting
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class T {
+ function f(P $p = 42) {
+ }
+}
+?>
+--EXPECTF--
+
+Fatal error: Default value for parameters with a class type hint can only be NULL in %stype_hints_003.php on line 3
diff --git a/tests/output/bug46897.phpt b/tests/output/bug46897.phpt
new file mode 100644
index 0000000..8fe80bc
--- /dev/null
+++ b/tests/output/bug46897.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #46897: ob_flush() should fail to flush unerasable buffers
+--FILE--
+<?php
+function callback($string) {
+ static $callback_invocations;
+ $callback_invocations++;
+ return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "Attempt to flush unerasable buffer - should fail...";
+var_dump(ob_flush());
+// Check content of buffer after flush - if flush failed it should still contain the string above.
+var_dump(ob_get_contents());
+echo 'Done';
+?>
+--EXPECTF--
+[callback:1]Attempt to flush unerasable buffer - should fail...
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d
+bool(false)
+string(%d) "Attempt to flush unerasable buffer - should fail...
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d
+bool(false)
+"
+Done
diff --git a/tests/output/bug60282.phpt b/tests/output/bug60282.phpt
new file mode 100644
index 0000000..08bcc0f
--- /dev/null
+++ b/tests/output/bug60282.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #60282 (Segfault when using ob_gzhandler() with open buffers)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip Zlib extension required"; ?>
+--FILE--
+<?php
+ob_start();
+ob_start();
+ob_start('ob_gzhandler');
+echo "done";
+--EXPECT--
+done
diff --git a/tests/output/bug60321.phpt b/tests/output/bug60321.phpt
new file mode 100644
index 0000000..9802a57
--- /dev/null
+++ b/tests/output/bug60321.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty)
+--FILE--
+<?php
+$return = ob_get_status(true);
+var_dump($return);
+--EXPECT--
+array(0) {
+}
diff --git a/tests/output/bug60322.phpt b/tests/output/bug60322.phpt
new file mode 100644
index 0000000..c28ab4d
--- /dev/null
+++ b/tests/output/bug60322.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #60322 (ob_get_clean() now raises an E_NOTICE if no buffers exist)
+--FILE--
+<?php
+while(ob_get_clean()) ;
+var_dump(ob_get_clean());
+--EXPECT--
+bool(false)
diff --git a/tests/output/bug60768.phpt b/tests/output/bug60768.phpt
new file mode 100644
index 0000000..2527e8e
--- /dev/null
+++ b/tests/output/bug60768.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #60768 Output buffer not discarded
+--FILE--
+<?php
+
+global $storage;
+
+ob_start(function($buffer) use (&$storage) { $storage .= $buffer; }, 20);
+
+echo str_repeat("0", 20); // fill in the buffer
+
+for($i = 0; $i < 10; $i++) {
+ echo str_pad($i, 9, ' ', STR_PAD_LEFT) . "\n"; // full buffer dumped every time
+}
+
+ob_end_flush();
+
+printf("Output size: %d, expected %d\n", strlen($storage), 20 + 10 * 10);
+
+?>
+DONE
+--EXPECT--
+Output size: 120, expected 120
+DONE
+
diff --git a/tests/output/flush_basic_001.phpt b/tests/output/flush_basic_001.phpt
new file mode 100644
index 0000000..d9bb639
--- /dev/null
+++ b/tests/output/flush_basic_001.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Test basic functionality of flush()
+--FILE--
+<?php
+/*
+ * proto void flush(void)
+ * Function is implemented in ext/standard/basic_functions.c.
+ */
+
+// Verify return type
+var_dump(flush());
+
+// Ensure user buffers are not flushed by flush()
+ob_start();
+echo "Inside a user buffer\n";
+flush();
+ob_end_clean();
+
+echo "Outside of any user buffers\n";
+var_dump(flush());
+
+?>
+--EXPECT--
+NULL
+Outside of any user buffers
+NULL \ No newline at end of file
diff --git a/tests/output/flush_error_001.phpt b/tests/output/flush_error_001.phpt
new file mode 100644
index 0000000..720c0d5
--- /dev/null
+++ b/tests/output/flush_error_001.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Test wrong number of arguments for flush() (no impact)
+--FILE--
+<?php
+/*
+ * proto void flush(void)
+ * Function is implemented in ext/standard/basic_functions.c.
+ */
+
+$extra_arg = 1;
+echo "\nToo many arguments\n";
+var_dump(flush($extra_arg));
+?>
+--EXPECTF--
+Too many arguments
+NULL \ No newline at end of file
diff --git a/tests/output/ob_001.phpt b/tests/output/ob_001.phpt
new file mode 100644
index 0000000..ecacf02
--- /dev/null
+++ b/tests/output/ob_001.phpt
@@ -0,0 +1,8 @@
+--TEST--
+output buffering - nothing
+--FILE--
+<?php
+echo "foo\n";
+?>
+--EXPECT--
+foo
diff --git a/tests/output/ob_002.phpt b/tests/output/ob_002.phpt
new file mode 100644
index 0000000..94f515b
--- /dev/null
+++ b/tests/output/ob_002.phpt
@@ -0,0 +1,9 @@
+--TEST--
+output buffering - ob_start
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+?>
+--EXPECT--
+foo
diff --git a/tests/output/ob_003.phpt b/tests/output/ob_003.phpt
new file mode 100644
index 0000000..988d197
--- /dev/null
+++ b/tests/output/ob_003.phpt
@@ -0,0 +1,13 @@
+--TEST--
+output buffering - ob_flush
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_flush();
+echo "bar\n";
+ob_flush();
+?>
+--EXPECT--
+foo
+bar
diff --git a/tests/output/ob_004.phpt b/tests/output/ob_004.phpt
new file mode 100644
index 0000000..a089a8c
--- /dev/null
+++ b/tests/output/ob_004.phpt
@@ -0,0 +1,11 @@
+--TEST--
+output buffering - ob_clean
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_clean();
+echo "bar\n";
+?>
+--EXPECT--
+bar
diff --git a/tests/output/ob_005.phpt b/tests/output/ob_005.phpt
new file mode 100644
index 0000000..bbe807d
--- /dev/null
+++ b/tests/output/ob_005.phpt
@@ -0,0 +1,14 @@
+--TEST--
+output buffering - ob_end_clean
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_start();
+echo "bar\n";
+ob_end_clean();
+echo "baz\n";
+?>
+--EXPECT--
+foo
+baz
diff --git a/tests/output/ob_006.phpt b/tests/output/ob_006.phpt
new file mode 100644
index 0000000..aec3cfc
--- /dev/null
+++ b/tests/output/ob_006.phpt
@@ -0,0 +1,12 @@
+--TEST--
+output buffering - ob_end_flush
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+ob_end_flush();
+var_dump(ob_get_level());
+?>
+--EXPECT--
+foo
+int(0)
diff --git a/tests/output/ob_007.phpt b/tests/output/ob_007.phpt
new file mode 100644
index 0000000..059925c
--- /dev/null
+++ b/tests/output/ob_007.phpt
@@ -0,0 +1,11 @@
+--TEST--
+output buffering - ob_get_clean
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+var_dump(ob_get_clean());
+?>
+--EXPECT--
+string(4) "foo
+"
diff --git a/tests/output/ob_008.phpt b/tests/output/ob_008.phpt
new file mode 100644
index 0000000..17a8081
--- /dev/null
+++ b/tests/output/ob_008.phpt
@@ -0,0 +1,11 @@
+--TEST--
+output buffering - ob_get_contents
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+echo ob_get_contents();
+?>
+--EXPECT--
+foo
+foo
diff --git a/tests/output/ob_009.phpt b/tests/output/ob_009.phpt
new file mode 100644
index 0000000..80edb46
--- /dev/null
+++ b/tests/output/ob_009.phpt
@@ -0,0 +1,12 @@
+--TEST--
+output buffering - ob_get_flush
+--FILE--
+<?php
+ob_start();
+echo "foo\n";
+var_dump(ob_get_flush());
+?>
+--EXPECT--
+foo
+string(4) "foo
+"
diff --git a/tests/output/ob_010.phpt b/tests/output/ob_010.phpt
new file mode 100644
index 0000000..24d650c
--- /dev/null
+++ b/tests/output/ob_010.phpt
@@ -0,0 +1,13 @@
+--TEST--
+output buffering - fatalism
+--FILE--
+<?php
+function obh($s)
+{
+ print_r($s, 1);
+}
+ob_start("obh");
+echo "foo\n";
+?>
+--EXPECTF--
+Fatal error: print_r(): Cannot use output buffering in output buffering display handlers in %sob_010.php on line %d
diff --git a/tests/output/ob_011.phpt b/tests/output/ob_011.phpt
new file mode 100644
index 0000000..35b0388
--- /dev/null
+++ b/tests/output/ob_011.phpt
@@ -0,0 +1,13 @@
+--TEST--
+output buffering - fatalism
+--FILE--
+<?php
+function obh($s)
+{
+ return ob_get_flush();
+}
+ob_start("obh");
+echo "foo\n";
+?>
+--EXPECTF--
+Fatal error: ob_get_flush(): Cannot use output buffering in output buffering display handlers in %sob_011.php on line %d
diff --git a/tests/output/ob_012.phpt b/tests/output/ob_012.phpt
new file mode 100644
index 0000000..9e6e885
--- /dev/null
+++ b/tests/output/ob_012.phpt
@@ -0,0 +1,22 @@
+--TEST--
+output buffering - multiple
+--FILE--
+<?php
+echo 0;
+ ob_start();
+ ob_start();
+ ob_start();
+ ob_start();
+ echo 1;
+ ob_end_flush();
+ echo 2;
+ $ob = ob_get_clean();
+ echo 3;
+ ob_flush();
+ ob_end_clean();
+ echo 4;
+ ob_end_flush();
+echo $ob;
+?>
+--EXPECT--
+03412
diff --git a/tests/output/ob_013.phpt b/tests/output/ob_013.phpt
new file mode 100644
index 0000000..ad2e36d
--- /dev/null
+++ b/tests/output/ob_013.phpt
@@ -0,0 +1,105 @@
+--TEST--
+output buffering - handlers/status
+--FILE--
+<?php
+function a($s){return $s;}
+function b($s){return $s;}
+function c($s){return $s;}
+function d($s){return $s;}
+
+ob_start();
+ob_start('a');
+ob_start('b');
+ob_start('c');
+ob_start('d');
+ob_start();
+
+echo "foo\n";
+
+ob_flush();
+ob_end_clean();
+ob_flush();
+
+print_r(ob_list_handlers());
+print_r(ob_get_status());
+print_r(ob_get_status(true));
+
+?>
+--EXPECTF--
+foo
+Array
+(
+ [0] => default output handler
+ [1] => a
+ [2] => b
+ [3] => c
+ [4] => d
+)
+Array
+(
+ [name] => d
+ [type] => 1
+ [flags] => 20593
+ [level] => 4
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 96
+)
+Array
+(
+ [0] => Array
+ (
+ [name] => default output handler
+ [type] => 0
+ [flags] => 112
+ [level] => 0
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 0
+ )
+
+ [1] => Array
+ (
+ [name] => a
+ [type] => 1
+ [flags] => 113
+ [level] => 1
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 0
+ )
+
+ [2] => Array
+ (
+ [name] => b
+ [type] => 1
+ [flags] => 113
+ [level] => 2
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 0
+ )
+
+ [3] => Array
+ (
+ [name] => c
+ [type] => 1
+ [flags] => 113
+ [level] => 3
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => 4
+ )
+
+ [4] => Array
+ (
+ [name] => d
+ [type] => 1
+ [flags] => 20593
+ [level] => 4
+ [chunk_size] => %d
+ [buffer_size] => 16384
+ [buffer_used] => %d
+ )
+
+)
diff --git a/tests/output/ob_014.phpt b/tests/output/ob_014.phpt
new file mode 100644
index 0000000..0953427
--- /dev/null
+++ b/tests/output/ob_014.phpt
@@ -0,0 +1,22 @@
+--TEST--
+output buffering - failure
+--FILE--
+<?php
+ob_start("str_rot13");
+echo "foo\n";
+// str_rot13 expects 1 param and returns NULL when passed 2 params.
+// It is invoked with 2 params when used as an OB callback.
+// Therefore, there will be no data in the buffer. This is expected: see bug 46900.
+ob_end_flush();
+
+// Show the error.
+print_r(error_get_last());
+?>
+--EXPECTF--
+Array
+(
+ [type] => 2
+ [message] => str_rot13() expects exactly 1 parameter, 2 given
+ [file] => %s
+ [line] => 7
+)
diff --git a/tests/output/ob_015.phpt b/tests/output/ob_015.phpt
new file mode 100644
index 0000000..2acdb40
--- /dev/null
+++ b/tests/output/ob_015.phpt
@@ -0,0 +1,22 @@
+--TEST--
+output buffering - failure
+--FILE--
+<?php
+ob_start("str_rot13", 1);
+echo "foo\n";
+// str_rot13 expects 1 param and returns NULL when passed 2 params.
+// It is invoked with 2 params when used as an OB callback.
+// Therefore, there will be no data in the buffer. This is expected: see bug 46900.
+ob_end_flush();
+
+// Show the error.
+print_r(error_get_last());
+?>
+--EXPECTF--
+Array
+(
+ [type] => 2
+ [message] => str_rot13() expects exactly 1 parameter, 2 given
+ [file] => %s
+ [line] => 7
+)
diff --git a/tests/output/ob_017.phpt b/tests/output/ob_017.phpt
new file mode 100644
index 0000000..517fafe
--- /dev/null
+++ b/tests/output/ob_017.phpt
@@ -0,0 +1,34 @@
+--TEST--
+output buffering - stati
+--FILE--
+<?php
+$stati = array();
+function oh($str, $flags) {
+ global $stati;
+ $stati[] = "$flags: $str";
+ return $str;
+}
+ob_start("oh", 3);
+echo "yes";
+echo "!\n";
+ob_flush();
+echo "no";
+ob_clean();
+echo "yes!\n";
+echo "no";
+ob_end_clean();
+print_r($stati);
+?>
+--EXPECT--
+yes!
+yes!
+Array
+(
+ [0] => 1: yes
+ [1] => 4: !
+
+ [2] => 2: no
+ [3] => 0: yes!
+
+ [4] => 10: no
+)
diff --git a/tests/output/ob_018.phpt b/tests/output/ob_018.phpt
new file mode 100644
index 0000000..1ff7d5a
--- /dev/null
+++ b/tests/output/ob_018.phpt
@@ -0,0 +1,17 @@
+--TEST--
+output buffering - error message nirvana bug #37714
+--SKIPIF--
+<?php
+if (!extension_loaded("zlib")) die("skip need ext/zlib");
+?>
+--ENV--
+HTTP_ACCEPT_ENCODING=gzip,deflate
+--INI--
+display_errors=1
+zlib.output_compression=1
+--FILE--
+<?php
+ob_start('ob_gzhandler');
+?>
+--EXPECTF--
+‹%a
diff --git a/tests/output/ob_020.phpt b/tests/output/ob_020.phpt
new file mode 100644
index 0000000..05f66cc
--- /dev/null
+++ b/tests/output/ob_020.phpt
@@ -0,0 +1,38 @@
+--TEST--
+output buffering - ob_list_handlers
+--FILE--
+<?php
+print_r(ob_list_handlers());
+
+ob_start();
+print_r(ob_list_handlers());
+
+ob_start();
+print_r(ob_list_handlers());
+
+ob_end_flush();
+print_r(ob_list_handlers());
+
+ob_end_flush();
+print_r(ob_list_handlers());
+?>
+--EXPECT--
+Array
+(
+)
+Array
+(
+ [0] => default output handler
+)
+Array
+(
+ [0] => default output handler
+ [1] => default output handler
+)
+Array
+(
+ [0] => default output handler
+)
+Array
+(
+)
diff --git a/tests/output/ob_clean_basic_001.phpt b/tests/output/ob_clean_basic_001.phpt
new file mode 100644
index 0000000..afaa7e2
--- /dev/null
+++ b/tests/output/ob_clean_basic_001.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Test ob_clean() function : basic functionality
+--FILE--
+<?php
+/* Prototype : proto bool ob_clean(void)
+ * Description: Clean (delete) the current output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_clean() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_clean() function with Zero arguments --\n";
+var_dump( ob_clean() );
+
+ob_start();
+echo "You should never see this.";
+var_dump(ob_clean());
+
+echo "Ensure the buffer is still active after the clean.";
+$out = ob_get_clean();
+var_dump($out);
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_clean() : basic functionality ***
+
+-- Testing ob_clean() function with Zero arguments --
+
+Notice: ob_clean(): failed to delete buffer. No buffer to delete in %s on line 12
+bool(false)
+string(61) "bool(true)
+Ensure the buffer is still active after the clean."
+Done
diff --git a/tests/output/ob_clean_error_001.phpt b/tests/output/ob_clean_error_001.phpt
new file mode 100644
index 0000000..ef1413a
--- /dev/null
+++ b/tests/output/ob_clean_error_001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_clean() function : error conditions
+--FILE--
+<?php
+/* Prototype : proto bool ob_clean(void)
+ * Description: Clean (delete) the current output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_clean() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_clean() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_clean($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_clean() : error conditions ***
+
+-- Testing ob_clean() function with one argument --
+
+Warning: ob_clean() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done \ No newline at end of file
diff --git a/tests/output/ob_end_clean_basic_001.phpt b/tests/output/ob_end_clean_basic_001.phpt
new file mode 100644
index 0000000..54e840b
--- /dev/null
+++ b/tests/output/ob_end_clean_basic_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+Test return type and value, as well as basic behaviour, for ob_end_clean()
+--FILE--
+<?php
+/*
+ * proto bool ob_end_clean(void)
+ * Function is implemented in main/output.c
+*/
+
+var_dump(ob_end_clean());
+
+ob_start();
+var_dump(ob_end_clean());
+
+ob_start();
+echo "Hello";
+var_dump(ob_end_clean());
+
+var_dump(ob_end_clean());
+
+?>
+--EXPECTF--
+
+Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in %s on line 7
+bool(false)
+bool(true)
+bool(true)
+
+Notice: ob_end_clean(): failed to delete buffer. No buffer to delete in %s on line 16
+bool(false)
+
diff --git a/tests/output/ob_end_clean_error_001.phpt b/tests/output/ob_end_clean_error_001.phpt
new file mode 100644
index 0000000..0279db7
--- /dev/null
+++ b/tests/output/ob_end_clean_error_001.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Test wrong number of arguments for ob_end_clean()
+--FILE--
+<?php
+/*
+ * proto bool ob_end_clean(void)
+ * Function is implemented in main/output.c
+*/
+
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(ob_end_clean($extra_arg));
+
+
+?>
+--EXPECTF--
+
+Too many arguments
+
+Warning: ob_end_clean() expects exactly 0 parameters, 1 given in %s on line 10
+NULL
diff --git a/tests/output/ob_end_flush_basic_001.phpt b/tests/output/ob_end_flush_basic_001.phpt
new file mode 100644
index 0000000..cba7802
--- /dev/null
+++ b/tests/output/ob_end_flush_basic_001.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Test ob_end_flush() function : basic functionality
+--FILE--
+<?php
+/* Prototype : proto bool ob_end_flush(void)
+ * Description: Flush (send) the output buffer, and delete current output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_end_flush() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_end_flush() function with Zero arguments --\n";
+var_dump(ob_end_flush());
+
+ob_start();
+var_dump(ob_end_flush());
+
+ob_start();
+echo "Hello\n";
+var_dump(ob_end_flush());
+
+var_dump(ob_end_flush());
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_end_flush() : basic functionality ***
+
+-- Testing ob_end_flush() function with Zero arguments --
+
+Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %s on line 12
+bool(false)
+bool(true)
+Hello
+bool(true)
+
+Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %s on line 21
+bool(false)
+Done
diff --git a/tests/output/ob_end_flush_error_001.phpt b/tests/output/ob_end_flush_error_001.phpt
new file mode 100644
index 0000000..7675f00
--- /dev/null
+++ b/tests/output/ob_end_flush_error_001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_end_flush() function : error conditions
+--FILE--
+<?php
+/* Prototype : proto bool ob_end_flush(void)
+ * Description: Flush (send) the output buffer, and delete current output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_end_flush() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_end_flush() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_end_flush($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_end_flush() : error conditions ***
+
+-- Testing ob_end_flush() function with one argument --
+
+Warning: ob_end_flush() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done
diff --git a/tests/output/ob_flush_basic_001.phpt b/tests/output/ob_flush_basic_001.phpt
new file mode 100644
index 0000000..57de5e3
--- /dev/null
+++ b/tests/output/ob_flush_basic_001.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Test ob_flush() function : basic functionality
+--FILE--
+<?php
+/* Prototype : proto bool ob_flush(void)
+ * Description: Flush (send) contents of the output buffer. The last buffer content is sent to next buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_flush() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_flush() function with Zero arguments --\n";
+var_dump(ob_flush());
+
+ob_start();
+echo "This should get flushed.\n";
+var_dump(ob_flush());
+
+echo "Ensure the buffer is still active after the flush.\n";
+$out = ob_flush();
+var_dump($out);
+
+echo "Done";
+
+?>
+--EXPECTF--
+*** Testing ob_flush() : basic functionality ***
+
+-- Testing ob_flush() function with Zero arguments --
+
+Notice: ob_flush(): failed to flush buffer. No buffer to flush in %s on line 12
+bool(false)
+This should get flushed.
+bool(true)
+Ensure the buffer is still active after the flush.
+bool(true)
+Done
diff --git a/tests/output/ob_flush_error_001.phpt b/tests/output/ob_flush_error_001.phpt
new file mode 100644
index 0000000..f985040
--- /dev/null
+++ b/tests/output/ob_flush_error_001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_flush() function : error conditions
+--FILE--
+<?php
+/* Prototype : proto bool ob_flush(void)
+ * Description: Flush (send) contents of the output buffer. The last buffer content is sent to next buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_flush() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_flush() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_flush($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_flush() : error conditions ***
+
+-- Testing ob_flush() function with one argument --
+
+Warning: ob_flush() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done
diff --git a/tests/output/ob_get_clean_basic_001.phpt b/tests/output/ob_get_clean_basic_001.phpt
new file mode 100644
index 0000000..635b58a
--- /dev/null
+++ b/tests/output/ob_get_clean_basic_001.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Test return type and value, as well as basic behaviour, of ob_get_clean()
+--FILE--
+<?php
+/*
+ * proto bool ob_get_clean(void)
+ * Function is implemented in main/output.c
+*/
+
+var_dump(ob_get_clean());
+
+ob_start();
+echo "Hello World";
+var_dump(ob_get_clean());
+?>
+--EXPECTF--
+bool(false)
+string(11) "Hello World"
diff --git a/tests/output/ob_get_clean_basic_002.phpt b/tests/output/ob_get_clean_basic_002.phpt
new file mode 100644
index 0000000..a599273
--- /dev/null
+++ b/tests/output/ob_get_clean_basic_002.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Test basic behaviour of ob_get_clean()
+--FILE--
+<?php
+/*
+ * proto bool ob_get_clean(void)
+ * Function is implemented in main/output.c
+*/
+
+ob_start();
+
+echo "Hello World";
+
+$out = ob_get_clean();
+$out = strtolower($out);
+
+var_dump($out);
+?>
+--EXPECT--
+string(11) "hello world" \ No newline at end of file
diff --git a/tests/output/ob_get_clean_error_001.phpt b/tests/output/ob_get_clean_error_001.phpt
new file mode 100644
index 0000000..a77a69e
--- /dev/null
+++ b/tests/output/ob_get_clean_error_001.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Test wrong number of arguments for ob_get_clean()
+--FILE--
+<?php
+/*
+ * proto bool ob_get_clean(void)
+ * Function is implemented in main/output.c
+*/
+
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(ob_get_clean($extra_arg));
+
+
+?>
+--EXPECTF--
+
+Too many arguments
+
+Warning: ob_get_clean() expects exactly 0 parameters, 1 given in %s on line 10
+NULL \ No newline at end of file
diff --git a/tests/output/ob_get_contents_basic_001.phpt b/tests/output/ob_get_contents_basic_001.phpt
new file mode 100644
index 0000000..a990245
--- /dev/null
+++ b/tests/output/ob_get_contents_basic_001.phpt
@@ -0,0 +1,73 @@
+--TEST--
+Test ob_get_contents() function : basic functionality
+--CREDITS--
+Iain Lewis <ilewis@php.net>
+--FILE--
+<?php
+/* Prototype : proto string ob_get_contents(void)
+ * Description: Return the contents of the output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+
+echo "*** Testing ob_get_contents() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_get_contents() function with Zero arguments --\n";
+/* Buffering not started yet, should return false */
+var_dump( ob_get_contents() );
+
+ob_start();
+echo "Hello World\n";
+$hello = ob_get_contents();
+var_dump($hello);
+ob_end_flush();
+
+
+echo "\ncheck that we dont have a reference\n";
+ob_start();
+echo "Hello World\n";
+$hello2 = ob_get_contents();
+$hello2 = "bob";
+var_dump(ob_get_contents());
+ob_end_flush();
+
+echo "\ncheck that contents disappear after a flush\n";
+ob_start();
+echo "Hello World\n";
+ob_flush();
+var_dump(ob_get_contents());
+ob_end_flush();
+
+echo "\ncheck that no contents found after an end\n";
+ob_start();
+echo "Hello World\n";
+ob_end_flush();
+var_dump(ob_get_contents());
+
+
+echo "Done\n";
+?>
+--EXPECTF--
+*** Testing ob_get_contents() : basic functionality ***
+
+-- Testing ob_get_contents() function with Zero arguments --
+bool(false)
+Hello World
+string(12) "Hello World
+"
+
+check that we dont have a reference
+Hello World
+string(12) "Hello World
+"
+
+check that contents disappear after a flush
+Hello World
+string(0) ""
+
+check that no contents found after an end
+Hello World
+bool(false)
+Done \ No newline at end of file
diff --git a/tests/output/ob_get_contents_error_001.phpt b/tests/output/ob_get_contents_error_001.phpt
new file mode 100644
index 0000000..94e3f31
--- /dev/null
+++ b/tests/output/ob_get_contents_error_001.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Test ob_get_contents() function : error cases
+--CREDITS--
+Iain Lewis <ilewis@php.net>
+--FILE--
+<?php
+/* Prototype : proto string ob_get_contents(void)
+ * Description: Return the contents of the output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+
+echo "*** Testing ob_get_contents() : error cases ***\n";
+
+var_dump(ob_get_contents("bob"));
+
+ob_start();
+
+var_dump(ob_get_contents("bob2",345));
+
+echo "Done\n";
+?>
+--EXPECTF--
+*** Testing ob_get_contents() : error cases ***
+
+Warning: ob_get_contents() expects exactly 0 parameters, 1 given in %s on line 11
+NULL
+
+Warning: ob_get_contents() expects exactly 0 parameters, 2 given in %s on line 15
+NULL
+Done
diff --git a/tests/output/ob_get_length_basic_001.phpt b/tests/output/ob_get_length_basic_001.phpt
new file mode 100644
index 0000000..98469c2
--- /dev/null
+++ b/tests/output/ob_get_length_basic_001.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Test return type and value, as well as basic behaviour, of ob_get_length()
+--FILE--
+<?php
+/*
+ * proto int ob_get_length(void)
+ * Function is implemented in main/output.c
+*/
+
+echo "No output buffers\n";
+var_dump(ob_get_length());
+
+ob_start();
+var_dump(ob_get_length());
+echo "hello\n";
+var_dump(ob_get_length());
+ob_flush();
+$value = ob_get_length();
+echo "hello\n";
+ob_clean();
+var_dump(ob_get_length());
+var_dump($value);
+ob_end_flush();
+
+echo "No output buffers\n";
+var_dump(ob_get_length());
+?>
+--EXPECTF--
+No output buffers
+bool(false)
+int(0)
+hello
+int(13)
+int(0)
+int(0)
+No output buffers
+bool(false) \ No newline at end of file
diff --git a/tests/output/ob_get_length_error_001.phpt b/tests/output/ob_get_length_error_001.phpt
new file mode 100644
index 0000000..8218b50
--- /dev/null
+++ b/tests/output/ob_get_length_error_001.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Test wrong number of arguments for ob_get_length()
+--FILE--
+<?php
+/*
+ * proto int ob_get_length(void)
+ * Function is implemented in main/output.c
+*/
+
+$extra_arg = 1;
+
+echo "\nToo many arguments\n";
+var_dump(ob_get_length($extra_arg));
+
+
+?>
+--EXPECTF--
+
+Too many arguments
+
+Warning: ob_get_length() expects exactly 0 parameters, 1 given in %s on line 10
+NULL \ No newline at end of file
diff --git a/tests/output/ob_get_level_basic_001.phpt b/tests/output/ob_get_level_basic_001.phpt
new file mode 100644
index 0000000..65f3291
--- /dev/null
+++ b/tests/output/ob_get_level_basic_001.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Test ob_get_level() function : basic functionality
+--FILE--
+<?php
+/* Prototype : proto int ob_get_level(void)
+ * Description: Return the nesting level of the output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_get_level() : basic functionality ***\n";
+
+// Zero arguments
+echo "\n-- Testing ob_get_level() function with Zero arguments --\n";
+var_dump(ob_get_level());
+
+ob_start();
+var_dump(ob_get_level());
+
+ob_start();
+var_dump(ob_get_level());
+
+ob_end_flush();
+var_dump(ob_get_level());
+
+ob_end_flush();
+var_dump(ob_get_level());
+
+ob_end_flush();
+var_dump(ob_get_level());
+
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_get_level() : basic functionality ***
+
+-- Testing ob_get_level() function with Zero arguments --
+int(0)
+int(1)
+int(2)
+int(1)
+int(0)
+
+Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %s on line 26
+int(0)
+Done
diff --git a/tests/output/ob_get_level_error_001.phpt b/tests/output/ob_get_level_error_001.phpt
new file mode 100644
index 0000000..326dd24
--- /dev/null
+++ b/tests/output/ob_get_level_error_001.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Test ob_get_level() function : error conditions
+--FILE--
+<?php
+/* Prototype : proto int ob_get_level(void)
+ * Description: Return the nesting level of the output buffer
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_get_level() : error conditions ***\n";
+
+// One argument
+echo "\n-- Testing ob_get_level() function with one argument --\n";
+$extra_arg = 10;;
+var_dump( ob_get_level($extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_get_level() : error conditions ***
+
+-- Testing ob_get_level() function with one argument --
+
+Warning: ob_get_level() expects exactly 0 parameters, 1 given in %s on line 13
+NULL
+Done \ No newline at end of file
diff --git a/tests/output/ob_get_status.phpt b/tests/output/ob_get_status.phpt
new file mode 100644
index 0000000..9580729
--- /dev/null
+++ b/tests/output/ob_get_status.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ob_get_status() function basic test
+--CREDITS--
+Sebastian SchÃŒrmann
+sebs@php.net
+Testfest 2009 Munich
+--FILE--
+<?php
+ob_start();
+$status = ob_get_status(true);
+ob_end_clean();
+var_dump($status);
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ array(7) {
+ ["name"]=>
+ string(22) "default output handler"
+ ["type"]=>
+ int(0)
+ ["flags"]=>
+ int(112)
+ ["level"]=>
+ int(0)
+ ["chunk_size"]=>
+ int(0)
+ ["buffer_size"]=>
+ int(16384)
+ ["buffer_used"]=>
+ int(0)
+ }
+}
diff --git a/tests/output/ob_implicit_flush_basic_001.phpt b/tests/output/ob_implicit_flush_basic_001.phpt
new file mode 100644
index 0000000..ab6f6a7
--- /dev/null
+++ b/tests/output/ob_implicit_flush_basic_001.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Test ob_implicit_flush() function : check return value (always null).
+--FILE--
+<?php
+/* Prototype : proto void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_implicit_flush() : check return value ***\n";
+
+var_dump(ob_implicit_flush());
+var_dump(ob_implicit_flush(true));
+var_dump(ob_implicit_flush(false));
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : check return value ***
+NULL
+NULL
+NULL
+Done
diff --git a/tests/output/ob_implicit_flush_basic_002.phpt b/tests/output/ob_implicit_flush_basic_002.phpt
new file mode 100644
index 0000000..6b378a7
--- /dev/null
+++ b/tests/output/ob_implicit_flush_basic_002.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Test ob_implicit_flush() function : ensure implicit flushing does not apply to user buffers.
+--FILE--
+<?php
+/* Prototype : proto void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_implicit_flush() : ensure implicit flushing does not apply to user buffers. ***\n";
+
+// Start a user buffer
+ob_start();
+// Switch on implicit flushing.
+ob_implicit_flush(1);
+
+echo "This is being written to a user buffer.\n";
+echo "Note that even though implicit flushing is on, you should never see this,\n";
+echo "because implicit flushing affects only the top level buffer, not user buffers.\n";
+
+// Wipe the user buffer. Nothing should have been flushed.
+ob_end_clean();
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : ensure implicit flushing does not apply to user buffers. ***
+Done \ No newline at end of file
diff --git a/tests/output/ob_implicit_flush_error_001.phpt b/tests/output/ob_implicit_flush_error_001.phpt
new file mode 100644
index 0000000..1df38ca
--- /dev/null
+++ b/tests/output/ob_implicit_flush_error_001.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Test ob_implicit_flush() function : wrong number of arguments
+--FILE--
+<?php
+/* Prototype : proto void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_implicit_flush() : error conditions ***\n";
+
+
+//Test ob_implicit_flush with one more than the expected number of arguments
+echo "\n-- Testing ob_implicit_flush() function with more than expected no. of arguments --\n";
+$flag = 10;
+$extra_arg = 10;
+var_dump( ob_implicit_flush($flag, $extra_arg) );
+
+echo "Done";
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : error conditions ***
+
+-- Testing ob_implicit_flush() function with more than expected no. of arguments --
+
+Warning: ob_implicit_flush() expects at most 1 parameter, 2 given in %s on line 15
+NULL
+Done \ No newline at end of file
diff --git a/tests/output/ob_implicit_flush_variation_001.phpt b/tests/output/ob_implicit_flush_variation_001.phpt
new file mode 100644
index 0000000..ef5a9ef
--- /dev/null
+++ b/tests/output/ob_implicit_flush_variation_001.phpt
@@ -0,0 +1,192 @@
+--TEST--
+Test ob_implicit_flush() function : usage variation
+--FILE--
+<?php
+/* Prototype : void ob_implicit_flush([int flag])
+ * Description: Turn implicit flush on/off and is equivalent to calling flush() after every output call
+ * Source code: main/output.c
+ * Alias to functions:
+ */
+
+echo "*** Testing ob_implicit_flush() : usage variation ***\n";
+
+// Define error handler
+function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) {
+ if (error_reporting() != 0) {
+ // report non-silenced errors
+ echo "Error: $err_no - $err_msg, $filename($linenum)\n";
+ }
+}
+set_error_handler('test_error_handler');
+
+// Initialise function arguments not being substituted (if any)
+
+//get an unset variable
+$unset_var = 10;
+unset ($unset_var);
+
+// define some classes
+class classWithToString
+{
+ public function __toString() {
+ return "Class A object";
+ }
+}
+
+class classWithoutToString
+{
+}
+
+// heredoc string
+$heredoc = <<<EOT
+hello world
+EOT;
+
+// add arrays
+$index_array = array (1, 2, 3);
+$assoc_array = array ('one' => 1, 'two' => 2);
+
+//array of values to iterate over
+$inputs = array(
+
+ // float data
+ 'float 10.5' => 10.5,
+ 'float -10.5' => -10.5,
+ 'float 12.3456789000e10' => 12.3456789000e10,
+ 'float -12.3456789000e10' => -12.3456789000e10,
+ 'float .5' => .5,
+
+ // array data
+ 'empty array' => array(),
+ 'int indexed array' => $index_array,
+ 'associative array' => $assoc_array,
+ 'nested arrays' => array('foo', $index_array, $assoc_array),
+
+ // null data
+ 'uppercase NULL' => NULL,
+ 'lowercase null' => null,
+
+ // boolean data
+ 'lowercase true' => true,
+ 'lowercase false' =>false,
+ 'uppercase TRUE' =>TRUE,
+ 'uppercase FALSE' =>FALSE,
+
+ // empty data
+ 'empty string DQ' => "",
+ 'empty string SQ' => '',
+
+ // string data
+ 'string DQ' => "string",
+ 'string SQ' => 'string',
+ 'mixed case string' => "sTrInG",
+ 'heredoc' => $heredoc,
+
+ // object data
+ 'instance of classWithToString' => new classWithToString(),
+ 'instance of classWithoutToString' => new classWithoutToString(),
+
+ // undefined data
+ 'undefined var' => @$undefined_var,
+
+ // unset data
+ 'unset var' => @$unset_var,
+);
+
+// loop through each element of the array for flag
+
+foreach($inputs as $key =>$value) {
+ echo "\n--$key--\n";
+ var_dump( ob_implicit_flush($value) );
+};
+
+?>
+--EXPECTF--
+*** Testing ob_implicit_flush() : usage variation ***
+
+--float 10.5--
+NULL
+
+--float -10.5--
+NULL
+
+--float 12.3456789000e10--
+NULL
+
+--float -12.3456789000e10--
+NULL
+
+--float .5--
+NULL
+
+--empty array--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, %s(97)
+NULL
+
+--int indexed array--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, %s(97)
+NULL
+
+--associative array--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, %s(97)
+NULL
+
+--nested arrays--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, array given, %s(97)
+NULL
+
+--uppercase NULL--
+NULL
+
+--lowercase null--
+NULL
+
+--lowercase true--
+NULL
+
+--lowercase false--
+NULL
+
+--uppercase TRUE--
+NULL
+
+--uppercase FALSE--
+NULL
+
+--empty string DQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, %unicode_string_optional% given, %s(97)
+NULL
+
+--empty string SQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, %unicode_string_optional% given, %s(97)
+NULL
+
+--string DQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, %unicode_string_optional% given, %s(97)
+NULL
+
+--string SQ--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, %unicode_string_optional% given, %s(97)
+NULL
+
+--mixed case string--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, %unicode_string_optional% given, %s(97)
+NULL
+
+--heredoc--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, %unicode_string_optional% given, %s(97)
+NULL
+
+--instance of classWithToString--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, object given, %s(97)
+NULL
+
+--instance of classWithoutToString--
+Error: 2 - ob_implicit_flush() expects parameter 1 to be long, object given, %s(97)
+NULL
+
+--undefined var--
+NULL
+
+--unset var--
+NULL \ No newline at end of file
diff --git a/tests/output/ob_start_basic_001.phpt b/tests/output/ob_start_basic_001.phpt
new file mode 100644
index 0000000..d93a731
--- /dev/null
+++ b/tests/output/ob_start_basic_001.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Test return type and value for ob_start()
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+var_dump(ob_start());
+
+?>
+--EXPECT--
+bool(true) \ No newline at end of file
diff --git a/tests/output/ob_start_basic_002.phpt b/tests/output/ob_start_basic_002.phpt
new file mode 100644
index 0000000..92d9069
--- /dev/null
+++ b/tests/output/ob_start_basic_002.phpt
@@ -0,0 +1,55 @@
+--TEST--
+ob_start(): Check behaviour with various callback return values.
+--FILE--
+<?php
+function return_empty_string($string) {
+ return "";
+}
+
+function return_false($string) {
+ return false;
+}
+
+function return_null($string) {
+ return null;
+}
+
+function return_string($string) {
+ return "I stole your output.";
+}
+
+function return_zero($string) {
+ return 0;
+}
+
+// Use each of the above functions as an output buffering callback:
+$functions = get_defined_functions();
+$callbacks = $functions['user'];
+sort($callbacks);
+foreach ($callbacks as $callback) {
+ echo "--> Use callback '$callback':\n";
+ ob_start($callback);
+ echo 'My output.';
+ ob_end_flush();
+ echo "\n\n";
+}
+
+?>
+==DONE==
+--EXPECTF--
+--> Use callback 'return_empty_string':
+
+
+--> Use callback 'return_false':
+My output.
+
+--> Use callback 'return_null':
+
+
+--> Use callback 'return_string':
+I stole your output.
+
+--> Use callback 'return_zero':
+0
+
+==DONE== \ No newline at end of file
diff --git a/tests/output/ob_start_basic_003.phpt b/tests/output/ob_start_basic_003.phpt
new file mode 100644
index 0000000..ebd883a
--- /dev/null
+++ b/tests/output/ob_start_basic_003.phpt
@@ -0,0 +1,18 @@
+--TEST--
+ob_start(): ensure even fatal error test is affected by output buffering.
+--FILE--
+<?php
+
+function f() {
+ return "I have stolen your output";
+}
+
+ob_start('f');
+cause_fatal_error(); // call undefined function
+ob_end_flush();
+
+echo "done (you shouldn't see this)";
+
+?>
+--EXPECTF--
+I have stolen your output \ No newline at end of file
diff --git a/tests/output/ob_start_basic_004.phpt b/tests/output/ob_start_basic_004.phpt
new file mode 100644
index 0000000..16f09e8
--- /dev/null
+++ b/tests/output/ob_start_basic_004.phpt
@@ -0,0 +1,132 @@
+--TEST--
+ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size.
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+// In HEAD, $chunk_size value of 1 should not have any special behaviour (http://marc.info/?l=php-internals&m=123476465621346&w=2).
+function callback($string) {
+ global $callback_invocations;
+ $callback_invocations++;
+ $len = strlen($string);
+ return "f[call:$callback_invocations; len:$len]$string\n";
+}
+
+for ($cs=-1; $cs<10; $cs++) {
+ echo "\n----( chunk_size: $cs, output append size: 1 )----\n";
+ $callback_invocations=0;
+ ob_start('callback', $cs);
+ echo '1'; echo '2'; echo '3'; echo '4'; echo '5'; echo '6'; echo '7'; echo '8';
+ ob_end_flush();
+}
+
+for ($cs=-1; $cs<10; $cs++) {
+ echo "\n----( chunk_size: $cs, output append size: 4 )----\n";
+ $callback_invocations=0;
+ ob_start('callback', $cs);
+ echo '1234'; echo '5678';
+ ob_end_flush();
+}
+
+?>
+--EXPECTF--
+
+----( chunk_size: -1, output append size: 1 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 0, output append size: 1 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 1, output append size: 1 )----
+f[call:1; len:1]1
+f[call:2; len:1]2
+f[call:3; len:1]3
+f[call:4; len:1]4
+f[call:5; len:1]5
+f[call:6; len:1]6
+f[call:7; len:1]7
+f[call:8; len:1]8
+f[call:9; len:0]
+
+----( chunk_size: 2, output append size: 1 )----
+f[call:1; len:2]12
+f[call:2; len:2]34
+f[call:3; len:2]56
+f[call:4; len:2]78
+f[call:5; len:0]
+
+----( chunk_size: 3, output append size: 1 )----
+f[call:1; len:3]123
+f[call:2; len:3]456
+f[call:3; len:2]78
+
+----( chunk_size: 4, output append size: 1 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 5, output append size: 1 )----
+f[call:1; len:5]12345
+f[call:2; len:3]678
+
+----( chunk_size: 6, output append size: 1 )----
+f[call:1; len:6]123456
+f[call:2; len:2]78
+
+----( chunk_size: 7, output append size: 1 )----
+f[call:1; len:7]1234567
+f[call:2; len:1]8
+
+----( chunk_size: 8, output append size: 1 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 9, output append size: 1 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: -1, output append size: 4 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 0, output append size: 4 )----
+f[call:1; len:8]12345678
+
+----( chunk_size: 1, output append size: 4 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 2, output append size: 4 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 3, output append size: 4 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 4, output append size: 4 )----
+f[call:1; len:4]1234
+f[call:2; len:4]5678
+f[call:3; len:0]
+
+----( chunk_size: 5, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 6, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 7, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 8, output append size: 4 )----
+f[call:1; len:8]12345678
+f[call:2; len:0]
+
+----( chunk_size: 9, output append size: 4 )----
+f[call:1; len:8]12345678 \ No newline at end of file
diff --git a/tests/output/ob_start_basic_005.phpt b/tests/output/ob_start_basic_005.phpt
new file mode 100644
index 0000000..4048ad2
--- /dev/null
+++ b/tests/output/ob_start_basic_005.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ob_start(): non-static method as static callbacks.
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+Class C {
+ function h($string) {
+ return $string;
+ }
+}
+
+function checkAndClean() {
+ print_r(ob_list_handlers());
+ while (ob_get_level()>0) {
+ ob_end_flush();
+ }
+}
+
+var_dump(ob_start('C::h'));
+checkAndClean();
+
+?>
+--EXPECTF--
+Warning: ob_start(): non-static method C::h() should not be called statically in %s on line 20
+bool(true)
+Array
+(
+ [0] => C::h
+)
diff --git a/tests/output/ob_start_basic_006.phpt b/tests/output/ob_start_basic_006.phpt
new file mode 100644
index 0000000..464e71b
--- /dev/null
+++ b/tests/output/ob_start_basic_006.phpt
@@ -0,0 +1,135 @@
+--TEST--
+ob_start(): ensure multiple buffer initialization with a single call using arrays is not supported on PHP6 (http://bugs.php.net/42641)
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+function f($string) {
+ static $i=0;
+ $i++;
+ $len = strlen($string);
+ return "f[call:$i; len:$len] - $string\n";
+}
+
+Class C {
+ public $id = 'none';
+
+ function __construct($id) {
+ $this->id = $id;
+ }
+
+ static function g($string) {
+ static $i=0;
+ $i++;
+ $len = strlen($string);
+ return "C::g[call:$i; len:$len] - $string\n";
+ }
+
+ function h($string) {
+ static $i=0;
+ $i++;
+ $len = strlen($string);
+ return "C::h[call:$i; len:$len; id:$this->id] - $string\n";
+ }
+}
+
+function checkAndClean() {
+ print_r(ob_list_handlers());
+ while (ob_get_level()>0) {
+ ob_end_flush();
+ }
+}
+
+echo "\n ---> Test arrays: \n";
+var_dump(ob_start(array("f")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "f")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "C::g", "f", "C::g")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "non_existent", "f")));
+checkAndClean();
+
+var_dump(ob_start(array("f", "non_existent", "f", "f")));
+checkAndClean();
+
+$c = new c('originalID');
+var_dump(ob_start(array($c, "h")));
+checkAndClean();
+
+var_dump(ob_start(array($c, "h")));
+$c->id = 'changedID';
+checkAndClean();
+
+$c->id = 'changedIDagain';
+var_dump(ob_start(array('f', 'C::g', array(array($c, "g"), array($c, "h")))));
+checkAndClean();
+?>
+--EXPECTF--
+ ---> Test arrays:
+
+Warning: ob_start(): array must have exactly two members in %s on line 44
+
+Notice: ob_start(): failed to create buffer in %s on line 44
+bool(false)
+Array
+(
+)
+
+Warning: ob_start(): class 'f' not found in %s on line 47
+
+Notice: ob_start(): failed to create buffer in %s on line 47
+bool(false)
+Array
+(
+)
+
+Warning: ob_start(): array must have exactly two members in %s on line 50
+
+Notice: ob_start(): failed to create buffer in %s on line 50
+bool(false)
+Array
+(
+)
+
+Warning: ob_start(): array must have exactly two members in %s on line 53
+
+Notice: ob_start(): failed to create buffer in %s on line 53
+bool(false)
+Array
+(
+)
+
+Warning: ob_start(): array must have exactly two members in %s on line 56
+
+Notice: ob_start(): failed to create buffer in %s on line 56
+bool(false)
+Array
+(
+)
+C::h[call:1; len:37; id:originalID] - bool(true)
+Array
+(
+ [0] => C::h
+)
+
+C::h[call:2; len:37; id:changedID] - bool(true)
+Array
+(
+ [0] => C::h
+)
+
+
+Warning: ob_start(): array must have exactly two members in %s on line 68
+
+Notice: ob_start(): failed to create buffer in %s on line 68
+bool(false)
+Array
+(
+)
diff --git a/tests/output/ob_start_basic_unerasable_001.phpt b/tests/output/ob_start_basic_unerasable_001.phpt
new file mode 100644
index 0000000..8e7280e
--- /dev/null
+++ b/tests/output/ob_start_basic_unerasable_001.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ob_start(): Ensure content of unerasable buffer can be accessed by ob_get_contents().
+--FILE--
+<?php
+function callback($string) {
+ static $callback_invocations;
+ $callback_invocations++;
+ return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "This call will obtain the content:\n";
+$str = ob_get_contents();
+var_dump($str);
+?>
+==DONE==
+--EXPECTF--
+[callback:1]This call will obtain the content:
+string(35) "This call will obtain the content:
+"
+==DONE== \ No newline at end of file
diff --git a/tests/output/ob_start_basic_unerasable_002.phpt b/tests/output/ob_start_basic_unerasable_002.phpt
new file mode 100644
index 0000000..21db1f3
--- /dev/null
+++ b/tests/output/ob_start_basic_unerasable_002.phpt
@@ -0,0 +1,33 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be erased by ob_clean(), ob_end_clean() or ob_end_flush().
+--FILE--
+<?php
+function callback($string) {
+ static $callback_invocations;
+ $callback_invocations++;
+ return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "All of the following calls will fail to clean/remove the topmost buffer:\n";
+var_dump(ob_clean());
+var_dump(ob_end_clean());
+var_dump(ob_end_flush());
+
+echo "The OB nesting will still be 1 level deep:\n";
+var_dump(ob_get_level());
+?>
+--EXPECTF--
+[callback:1]All of the following calls will fail to clean/remove the topmost buffer:
+
+Notice: ob_clean(): failed to delete buffer of callback (0) in %s on line 11
+bool(false)
+
+Notice: ob_end_clean(): failed to discard buffer of callback (0) in %s on line 12
+bool(false)
+
+Notice: ob_end_flush(): failed to send buffer of callback (0) in %s on line 13
+bool(false)
+The OB nesting will still be 1 level deep:
+int(1) \ No newline at end of file
diff --git a/tests/output/ob_start_basic_unerasable_003.phpt b/tests/output/ob_start_basic_unerasable_003.phpt
new file mode 100644
index 0000000..6eb6418
--- /dev/null
+++ b/tests/output/ob_start_basic_unerasable_003.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be accessed or erased by ob_get_clean().
+--FILE--
+<?php
+function callback($string) {
+ static $callback_invocations;
+ $callback_invocations++;
+ return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "This call will obtain the content, but will not clean the buffer.";
+$str = ob_get_clean();
+var_dump($str);
+?>
+--EXPECTF--
+[callback:1]This call will obtain the content, but will not clean the buffer.
+Notice: ob_get_clean(): failed to discard buffer of callback (0) in %s on line 11
+
+Notice: ob_get_clean(): failed to delete buffer of callback (0) in %s on line 11
+string(65) "This call will obtain the content, but will not clean the buffer." \ No newline at end of file
diff --git a/tests/output/ob_start_basic_unerasable_004.phpt b/tests/output/ob_start_basic_unerasable_004.phpt
new file mode 100644
index 0000000..62d9756
--- /dev/null
+++ b/tests/output/ob_start_basic_unerasable_004.phpt
@@ -0,0 +1,22 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be accessed or flushed by ob_get_flush().
+--FILE--
+<?php
+function callback($string) {
+ static $callback_invocations;
+ $callback_invocations++;
+ return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "This call will obtain the content, but will not flush the buffer.";
+$str = ob_get_flush();
+var_dump($str);
+?>
+--EXPECTF--
+[callback:1]This call will obtain the content, but will not flush the buffer.
+Notice: ob_get_flush(): failed to send buffer of callback (0) in %s on line 11
+
+Notice: ob_get_flush(): failed to delete buffer of callback (0) in %s on line 11
+string(65) "This call will obtain the content, but will not flush the buffer." \ No newline at end of file
diff --git a/tests/output/ob_start_basic_unerasable_005.phpt b/tests/output/ob_start_basic_unerasable_005.phpt
new file mode 100644
index 0000000..2c52f00
--- /dev/null
+++ b/tests/output/ob_start_basic_unerasable_005.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ob_start(): Ensure unerasable buffer cannot be flushed by ob_flush()
+--FILE--
+<?php
+function callback($string) {
+ static $callback_invocations;
+ $callback_invocations++;
+ return "[callback:$callback_invocations]$string\n";
+}
+
+ob_start('callback', 0, false);
+
+echo "Attempt to flush unerasable buffer - should fail... ";
+var_dump(ob_flush());
+// Check content of buffer after flush - if flush failed it should still contain the string above.
+var_dump(ob_get_contents());
+?>
+--EXPECTF--
+[callback:1]Attempt to flush unerasable buffer - should fail...
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11
+bool(false)
+string(%d) "Attempt to flush unerasable buffer - should fail...
+Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11
+bool(false)
+"
diff --git a/tests/output/ob_start_callbacks.phpt b/tests/output/ob_start_callbacks.phpt
new file mode 100644
index 0000000..da52d85
--- /dev/null
+++ b/tests/output/ob_start_callbacks.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Test ob_start() with callbacks in variables
+--FILE--
+<?php
+
+// Closure in variable
+$a = function ($s) { return strtoupper($s); };
+ob_start($a);
+echo 'closure in variable', "\n";
+ob_end_flush();
+
+// Object (array) in variable
+class foo {
+ static function out($foo) {
+ return strtoupper($foo);
+ }
+}
+$a = array('foo', 'out');
+ob_start($a);
+echo 'object in variable', "\n";
+ob_end_flush();
+
+// Object with static array
+ob_start(array('foo', 'out'));
+echo 'object via static array', "\n";
+ob_end_flush();
+
+function my_strtoupper($foo, $bar) {
+ return strtoupper($foo);
+}
+$a = 'my_strtoupper';
+ob_start($a);
+echo 'function via variable', "\n";
+ob_end_flush();
+--EXPECT--
+CLOSURE IN VARIABLE
+OBJECT IN VARIABLE
+OBJECT VIA STATIC ARRAY
+FUNCTION VIA VARIABLE
diff --git a/tests/output/ob_start_error_001.phpt b/tests/output/ob_start_error_001.phpt
new file mode 100644
index 0000000..b45de83
--- /dev/null
+++ b/tests/output/ob_start_error_001.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Test wrong number of arguments and wrong arg types for ob_start()
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+function justPrint($str) {
+ return $str;
+}
+
+$arg_1 = "justPrint";
+$arg_2 = 0;
+$arg_3 = false;
+$extra_arg = 1;
+
+echo "\n- Too many arguments\n";
+var_dump(ob_start($arg_1, $arg_2, $arg_3, $extra_arg));
+
+echo "\n- Arg 1 wrong type\n";
+var_dump(ob_start(1.5));
+
+echo "\n- Arg 2 wrong type\n";
+var_dump(ob_start("justPrint", "this should be an int"));
+
+echo "\n- Arg 3 wrong type\n";
+var_dump(ob_start("justPrint", 0, "this should be a bool"));
+
+?>
+--EXPECTF--
+- Too many arguments
+
+Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17
+NULL
+
+- Arg 1 wrong type
+
+Warning: ob_start(): no array or string given in %s on line 20
+
+Notice: ob_start(): failed to create buffer in %s on line 20
+bool(false)
+
+- Arg 2 wrong type
+
+Warning: ob_start() expects parameter 2 to be long, string given in %s on line 23
+NULL
+
+- Arg 3 wrong type
+
+Warning: ob_start() expects parameter 3 to be long, string given in %s on line 26
+NULL
diff --git a/tests/output/ob_start_error_002.phpt b/tests/output/ob_start_error_002.phpt
new file mode 100644
index 0000000..38c7899
--- /dev/null
+++ b/tests/output/ob_start_error_002.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Test wrong number of arguments and wrong arg types for ob_start()
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+Class C {
+ static function f($str) {
+ return $str;
+ }
+}
+
+var_dump(ob_start(array("nonExistent","f")));
+var_dump(ob_start(array("C","nonExistent")));
+var_dump(ob_start("C::no"));
+var_dump(ob_start("no"));
+echo "done"
+?>
+--EXPECTF--
+Warning: ob_start(): class 'nonExistent' not found in %s on line 13
+
+Notice: ob_start(): failed to create buffer in %s on line 13
+bool(false)
+
+Warning: ob_start(): class 'C' does not have a method 'nonExistent' in %s on line 14
+
+Notice: ob_start(): failed to create buffer in %s on line 14
+bool(false)
+
+Warning: ob_start(): class 'C' does not have a method 'no' in %s on line 15
+
+Notice: ob_start(): failed to create buffer in %s on line 15
+bool(false)
+
+Warning: ob_start(): function 'no' not found or invalid function name in %s on line 16
+
+Notice: ob_start(): failed to create buffer in %s on line 16
+bool(false)
+done
diff --git a/tests/output/ob_start_error_003.phpt b/tests/output/ob_start_error_003.phpt
new file mode 100644
index 0000000..7fa292a
--- /dev/null
+++ b/tests/output/ob_start_error_003.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Test ob_start() with object supplied but no method.
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+Class C {
+}
+
+$c = new C;
+var_dump(ob_start(array($c)));
+echo "done"
+?>
+--EXPECTF--
+Warning: ob_start(): array must have exactly two members in %s on line %d
+
+Notice: ob_start(): failed to create buffer in %s on line 11
+bool(false)
+done
diff --git a/tests/output/ob_start_error_004.phpt b/tests/output/ob_start_error_004.phpt
new file mode 100644
index 0000000..7ddf998
--- /dev/null
+++ b/tests/output/ob_start_error_004.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Test ob_start() with non existent callback method.
+--FILE--
+<?php
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+Class C {
+}
+
+$c = new C;
+var_dump(ob_start(array($c, 'f')));
+echo "done"
+?>
+--EXPECTF--
+Warning: ob_start(): class 'C' does not have a method 'f' in %s on line %d
+
+Notice: ob_start(): failed to create buffer in %s on line 11
+bool(false)
+done
diff --git a/tests/output/ob_start_error_005.phpt b/tests/output/ob_start_error_005.phpt
new file mode 100644
index 0000000..3e503c6
--- /dev/null
+++ b/tests/output/ob_start_error_005.phpt
@@ -0,0 +1,23 @@
+--TEST--
+ob_start(): ensure buffers can't be added from within callback.
+--FILE--
+<?php
+
+/*
+ * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]])
+ * Function is implemented in main/output.c
+*/
+
+function f($str) {
+ ob_start();
+ echo "hello";
+ ob_end_flush();
+ return $str;
+}
+
+
+var_dump(ob_start('f'));
+echo "done";
+?>
+--EXPECTF--
+Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in %s on line 9 \ No newline at end of file
diff --git a/tests/quicktester.inc b/tests/quicktester.inc
new file mode 100644
index 0000000..48ed6b5
--- /dev/null
+++ b/tests/quicktester.inc
@@ -0,0 +1,75 @@
+<?php
+ /*
+ Helper for simple tests to check return-value. Usage:
+
+ $tests = <<<TESTS
+ expected_return_value === expression
+ 2 === 1+1
+ 4 === 2*2
+ FALSE === @ fopen('non_existent_file')
+TESTS;
+ include( 'tests/quicktester.inc' );
+
+ Expect: OK
+
+ Remember to NOT put a trailing ; after a line!
+
+ */
+error_reporting(E_ALL);
+$tests = explode("\n",$tests);
+$success = TRUE;
+foreach ($tests as $n=>$test)
+{
+ // ignore empty lines
+ if (!$test) continue;
+
+ // warn for trailing ;
+ if (substr(trim($test), -1, 1) === ';') {
+ echo "WARNING: trailing ';' found in test ".($n+1)."\n";
+ exit;
+ }
+
+ // try for operators
+ $operators = array('===', '~==');
+ $operator = NULL;
+ foreach ($operators as $a_operator) {
+ if (strpos($test, $a_operator)!== FALSE) {
+ $operator = $a_operator;
+ list($left,$right) = explode($operator, $test);
+ break;
+ }
+ }
+ if (!$operator) {
+ echo "WARNING: unknown operator in '$test' (1)\n";
+ exit;
+ }
+
+ $left = eval("return ($left );");
+ $right = eval("return ($right);");
+ switch (@$operator) {
+ case '===': // exact match
+ $result = $left === $right;
+ break;
+ case '~==': // may differ after 12th significant number
+ if ( !is_float($left ) && !is_int($left )
+ || !is_float($right) && !is_int($right)) {
+ $result = FALSE;
+ break;
+ }
+ $result = abs(($left-$right) / $left) < 1e-12;
+ break;
+ default:
+ echo "WARNING: unknown operator in '$test' (2)\n";
+ exit;
+ }
+
+ $success = $success && $result;
+ if (!$result) {
+ echo "\nAssert failed:\n";
+ echo "$test\n";
+ echo "Left: ";var_dump($left );
+ echo "Right: ";var_dump($right);
+ }
+}
+if ($success) echo "OK";
+
diff --git a/tests/run-test/test001.phpt b/tests/run-test/test001.phpt
new file mode 100644
index 0000000..370d09c
--- /dev/null
+++ b/tests/run-test/test001.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECT
+--FILE--
+abc
+--EXPECT--
+abc \ No newline at end of file
diff --git a/tests/run-test/test002.phpt b/tests/run-test/test002.phpt
new file mode 100644
index 0000000..7b91f35
--- /dev/null
+++ b/tests/run-test/test002.phpt
@@ -0,0 +1,18 @@
+--TEST--
+EXPECTF
+--FILE--
+123
+-123
++123
++1.1
+abc
+0abc
+x
+--EXPECTF--
+%d
+%i
+%i
+%f
+%s
+%x
+%c \ No newline at end of file
diff --git a/tests/run-test/test003.phpt b/tests/run-test/test003.phpt
new file mode 100644
index 0000000..c1afad1
--- /dev/null
+++ b/tests/run-test/test003.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECTREGEX
+--FILE--
+abcde12314235xyz34264768286abcde
+--EXPECTREGEX--
+[abcde]+[0-5]*xyz[2-8]+abcde \ No newline at end of file
diff --git a/tests/run-test/test004.phpt b/tests/run-test/test004.phpt
new file mode 100644
index 0000000..19dbded
--- /dev/null
+++ b/tests/run-test/test004.phpt
@@ -0,0 +1,10 @@
+--TEST--
+INI section allows '='
+--INI--
+arg_separator.input==
+--FILE--
+<?php
+var_dump(ini_get('arg_separator.input'));
+?>
+--EXPECT--
+string(1) "=" \ No newline at end of file
diff --git a/tests/run-test/test005.phpt b/tests/run-test/test005.phpt
new file mode 100644
index 0000000..3d51531
--- /dev/null
+++ b/tests/run-test/test005.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Error message handling (without ZendOptimizer)
+--SKIPIF--
+<?php
+!extension_loaded("Zend Optimizer") or die("skip Zend Optimizer is loaded");
+?>
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+//
+// We check the general ini settings which affect error handling
+// and than verify if a message is given by a division by zero.
+// EXPECTF is used here since the error format may change but ut
+// should always contain 'Division by zero'.
+var_dump(ini_get('display_errors'));
+var_dump(ini_get('error_reporting'));
+var_dump(ini_get('log_errors'));
+var_dump(ini_get('track_errors'));
+ini_set('display_errors', 0);
+var_dump(ini_get('display_errors'));
+var_dump($php_errormsg);
+$error = 1 / 0;
+var_dump($php_errormsg);
+?>
+--EXPECTF--
+string(1) "1"
+string(5) "32767"
+string(1) "0"
+string(1) "1"
+string(1) "0"
+NULL
+string(%d) "%sivision by zer%s"
diff --git a/tests/run-test/test006.phpt b/tests/run-test/test006.phpt
new file mode 100644
index 0000000..4dca66a
--- /dev/null
+++ b/tests/run-test/test006.phpt
@@ -0,0 +1,9 @@
+--TEST--
+Error messages are shown
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+$error = 1 / 0;
+?>
+--EXPECTREGEX--
+.*Division by zero.*
diff --git a/tests/run-test/test007.phpt b/tests/run-test/test007.phpt
new file mode 100644
index 0000000..f5f934f
--- /dev/null
+++ b/tests/run-test/test007.phpt
Binary files differ
diff --git a/tests/run-test/test008.phpt b/tests/run-test/test008.phpt
new file mode 100644
index 0000000..41733d9
--- /dev/null
+++ b/tests/run-test/test008.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Error message handling (with ZendOptimizer)
+--SKIPIF--
+<?php
+extension_loaded("Zend Optimizer") or die("skip Zend Optimizer is not loaded");
+?>
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+//
+// We check the general ini settings which affect error handling
+// and than verify if a message is given by a division by zero.
+// EXPECTF is used here since the error format may change but ut
+// should always contain 'Division by zero'.
+var_dump(ini_get('display_errors'));
+var_dump(ini_get('error_reporting'));
+var_dump(ini_get('log_errors'));
+var_dump(ini_get('track_errors'));
+ini_set('display_errors', 0);
+var_dump(ini_get('display_errors'));
+var_dump($php_errormsg);
+$error = 1 / 0;
+var_dump($php_errormsg);
+?>
+--EXPECTF--
+%s: %sivision by zero in %s on line %d
+string(1) "1"
+string(4) "8191"
+string(1) "0"
+string(1) "1"
+string(1) "0"
+string(%d) "%sivision by zer%s"
+string(%d) "%sivision by zer%s"
diff --git a/tests/run-test/test008a.phpt b/tests/run-test/test008a.phpt
new file mode 100644
index 0000000..27da085
--- /dev/null
+++ b/tests/run-test/test008a.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Error message handling (without ZendOptimizer)
+--SKIPIF--
+<?php
+if (extension_loaded("Zend Optimizer")) die("skip Zend Optimizer is loaded");
+?>
+--FILE--
+<?php
+// If this test fails ask the developers of run-test.php
+//
+// We check the general ini settings which affect error handling
+// and than verify if a message is given by a division by zero.
+// EXPECTF is used here since the error format may change but ut
+// should always contain 'Division by zero'.
+var_dump(ini_get('display_errors'));
+var_dump(ini_get('error_reporting'));
+var_dump(ini_get('log_errors'));
+var_dump(ini_get('track_errors'));
+ini_set('display_errors', 0);
+var_dump(ini_get('display_errors'));
+var_dump($php_errormsg);
+$error = 1 / 0;
+var_dump($php_errormsg);
+?>
+--EXPECTF--
+string(1) "1"
+string(5) "32767"
+string(1) "0"
+string(1) "1"
+string(1) "0"
+NULL
+string(%d) "%sivision by zer%s"
diff --git a/tests/run-test/test009.phpt b/tests/run-test/test009.phpt
new file mode 100644
index 0000000..650686f
--- /dev/null
+++ b/tests/run-test/test009.phpt
@@ -0,0 +1,12 @@
+--TEST--
+print_r(Object)
+--FILE--
+<?php
+class Foo {}
+$foo = new Foo;
+print_r($foo);
+?>
+--EXPECTF--
+Foo Object
+(
+)
diff --git a/tests/run-test/test010.phpt b/tests/run-test/test010.phpt
new file mode 100644
index 0000000..cc3ca35
--- /dev/null
+++ b/tests/run-test/test010.phpt
@@ -0,0 +1,17 @@
+--TEST--
+STDIN input
+--FILE--
+<?php
+var_dump(stream_get_contents(STDIN));
+var_dump(stream_get_contents(fopen('php://stdin', 'r')));
+var_dump(file_get_contents('php://stdin'));
+?>
+--STDIN--
+fooBar
+use this to input some thing to the php script
+--EXPECT--
+string(54) "fooBar
+use this to input some thing to the php script
+"
+string(0) ""
+string(0) ""
diff --git a/tests/security/bug53226.phpt b/tests/security/bug53226.phpt
new file mode 100644
index 0000000..9556e46
--- /dev/null
+++ b/tests/security/bug53226.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #53226 (file_exists fails on big filenames)
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+create_directories();
+
+var_dump(file_exists('./test/ok/ok.txt'));
+var_dump(file_exists('./test/foo'));
+
+$file = str_repeat('x', 2 * PHP_MAXPATHLEN);
+var_dump(file_exists("./test/$file"));
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+
+Warning: file_exists(): File name is longer than the maximum allowed path length on this platform (%d): %s in %s on line %d
+bool(false)
diff --git a/tests/security/open_basedir.inc b/tests/security/open_basedir.inc
new file mode 100644
index 0000000..c5de8ca
--- /dev/null
+++ b/tests/security/open_basedir.inc
@@ -0,0 +1,139 @@
+<?php
+
+// This file contains helper functions for testing open_basedir configuration
+// Care must be taken with where the directories are created because different
+// SAPIs set the working directory differently. So simply creating a directory
+// relative to the current working directory like this: mkdir("blah") might
+// actually create it in several different places depending on the SAPI..!
+//
+// Note also depending on the version of php being tested, so the open_basedir
+// configuration may or may not be changeable from a script (PHP_INI_SYSTEM).
+//
+// For this reason we set the open_basedir to . (current directory) and then
+// move around to various directories for testing using chdir(). This is NOT
+// recommended for production use as . bypasses all semblence of security..!
+//
+// Although safe mode has been removed in php 6.0, open_basedir is still valid.
+// See http://www.php.net/features.safe-mode for more information
+
+function recursive_delete_directory($directory) {
+
+ // Remove any trailing slash first
+ if (substr($directory, -1) == '/') {
+ $directory = substr($directory, 0, -1);
+ }
+
+ // Make sure the directory is valid
+ if (is_dir($directory) == FALSE) {
+ return FALSE;
+ }
+
+ // Check we can access the directory
+ if (is_readable($directory) == FALSE) {
+ return FALSE;
+ }
+
+ $handle = opendir($directory);
+
+ // Scan through the directory contents
+ while (FALSE !== ($item = readdir($handle))) {
+ if ($item != '.') {
+ if ($item != '..') {
+ $path = ($directory.'/'.$item);
+ if (is_dir($path) == TRUE) {
+ recursive_delete_directory($path);
+ } else {
+ @chmod($path, 0777);
+ unlink($path);
+ }
+ }
+ }
+ }
+
+ closedir($handle);
+ @chmod($directory, 0777);
+ rmdir($directory);
+
+ return TRUE;
+}
+
+function create_directories() {
+ delete_directories();
+ $directory = getcwd();
+
+ var_dump(mkdir($directory."/test"));
+ var_dump(mkdir($directory."/test/ok"));
+ var_dump(mkdir($directory."/test/bad"));
+ file_put_contents($directory."/test/ok/ok.txt", "Hello World!");
+ file_put_contents($directory."/test/bad/bad.txt", "Hello World!");
+}
+
+function delete_directories() {
+ $directory = (getcwd()."/test");
+ recursive_delete_directory($directory);
+}
+
+function test_open_basedir_error($function) {
+ global $savedDirectory;
+ var_dump($function("../bad"));
+ var_dump($function("../bad/bad.txt"));
+ var_dump($function(".."));
+ var_dump($function("../"));
+ var_dump($function("/"));
+ var_dump($function("../bad/."));
+ $directory = $savedDirectory;
+ var_dump($function($directory."/test/bad/bad.txt"));
+ var_dump($function($directory."/test/bad/../bad/bad.txt"));
+}
+
+function test_open_basedir_before($function, $change = TRUE) {
+ global $savedDirectory;
+ echo "*** Testing open_basedir configuration [$function] ***\n";
+ $directory = getcwd();
+ $savedDirectory = $directory;
+ var_dump(chdir($directory));
+ create_directories();
+
+ // Optionally change directory
+ if ($change == TRUE) {
+ var_dump(chdir($directory."/test/ok"));
+ }
+}
+
+// Delete directories using a --CLEAN-- section!
+function test_open_basedir_after($function) {
+ echo "*** Finished testing open_basedir configuration [$function] ***\n";
+}
+
+// This is used by functions that return an array on success
+function test_open_basedir_array($function) {
+ global $savedDirectory;
+
+ test_open_basedir_before($function);
+ test_open_basedir_error($function);
+ var_dump(is_array($function("./../.")));
+ var_dump(is_array($function("../ok")));
+ var_dump(is_array($function("ok.txt")));
+ var_dump(is_array($function("../ok/ok.txt")));
+ $directory = $savedDirectory;
+ var_dump(is_array($function($directory."/test/ok/ok.txt")));
+ var_dump(is_array($function($directory."/test/ok/../ok/ok.txt")));
+ test_open_basedir_after($function);
+}
+
+function test_open_basedir($function) {
+ global $savedDirectory;
+ test_open_basedir_before($function);
+ test_open_basedir_error($function);
+ var_dump($function("./../."));
+ var_dump($function("../ok"));
+ var_dump($function("ok.txt"));
+ var_dump($function("../ok/ok.txt"));
+ $directory = $savedDirectory;
+ var_dump($function($directory."/test/ok/ok.txt"));
+ var_dump($function($directory."/test/ok/../ok/ok.txt"));
+ test_open_basedir_after($function);
+}
+
+?>
+
diff --git a/tests/security/open_basedir_001.phpt b/tests/security/open_basedir_001.phpt
new file mode 100644
index 0000000..9ea9559
--- /dev/null
+++ b/tests/security/open_basedir_001.phpt
@@ -0,0 +1,25 @@
+--TEST--
+openbase_dir runtime tightning
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip.. only for unix');
+}
+if (!is_dir("/usr/local/bin")) {
+ die('skip.. no /usr/local/bin on this machine');
+}
+--INI--
+open_basedir=/usr/local
+--FILE--
+<?php
+var_dump(ini_set("open_basedir", "/usr/local/bin"));
+var_dump(ini_get("open_basedir"));
+var_dump(ini_set("open_basedir", "/usr"));
+var_dump(ini_get("open_basedir"));
+?>
+--EXPECT--
+string(10) "/usr/local"
+string(14) "/usr/local/bin"
+bool(false)
+string(14) "/usr/local/bin"
+
diff --git a/tests/security/open_basedir_chdir.phpt b/tests/security/open_basedir_chdir.phpt
new file mode 100644
index 0000000..aa8cef5
--- /dev/null
+++ b/tests/security/open_basedir_chdir.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir_before("chdir");
+
+var_dump(chdir("../bad"));
+var_dump(chdir(".."));
+var_dump(chdir("../"));
+var_dump(chdir("/"));
+var_dump(chdir("../bad/."));
+var_dump(chdir("./../."));
+
+test_open_basedir_after("chdir");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [chdir] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: chdir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chdir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chdir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chdir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chdir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chdir(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+*** Finished testing open_basedir configuration [chdir] ***
+
diff --git a/tests/security/open_basedir_chmod.phpt b/tests/security/open_basedir_chmod.phpt
new file mode 100644
index 0000000..7256d6e
--- /dev/null
+++ b/tests/security/open_basedir_chmod.phpt
@@ -0,0 +1,72 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+
+test_open_basedir_before("chmod");
+
+var_dump(chmod("../bad", 0600));
+var_dump(chmod("../bad/bad.txt", 0600));
+var_dump(chmod("..", 0600));
+var_dump(chmod("../", 0600));
+var_dump(chmod("/", 0600));
+var_dump(chmod("../bad/.", 0600));
+var_dump(chmod("../bad/./bad.txt", 0600));
+var_dump(chmod("./../.", 0600));
+
+var_dump(chmod($initdir."/test/ok/ok.txt", 0600));
+var_dump(chmod("./ok.txt", 0600));
+var_dump(chmod("ok.txt", 0600));
+var_dump(chmod("../ok/ok.txt", 0600));
+var_dump(chmod("../ok/./ok.txt", 0600));
+chmod($initdir."/test/ok/ok.txt", 0777);
+
+test_open_basedir_after("chmod");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [chmod] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: chmod(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chmod(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chmod(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chmod(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chmod(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chmod(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chmod(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: chmod(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [chmod] ***
+
diff --git a/tests/security/open_basedir_copy.phpt b/tests/security/open_basedir_copy.phpt
new file mode 100644
index 0000000..7cb902a
--- /dev/null
+++ b/tests/security/open_basedir_copy.phpt
@@ -0,0 +1,78 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir_before("copy");
+
+var_dump(copy("ok.txt", "../bad"));
+var_dump(copy("ok.txt", "../bad/bad.txt"));
+var_dump(copy("ok.txt", ".."));
+var_dump(copy("ok.txt", "../"));
+var_dump(copy("ok.txt", "/"));
+var_dump(copy("ok.txt", "../bad/."));
+var_dump(copy("ok.txt", "../bad/./bad.txt"));
+var_dump(copy("ok.txt", "./../."));
+
+var_dump(copy("ok.txt", "copy.txt"));
+var_dump(unlink("copy.txt"));
+test_open_basedir_after("copy");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [copy] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: copy(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(../bad): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: copy(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(..): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: copy(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(../): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: copy(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(/): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: copy(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(../bad/.): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: copy(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(../bad/./bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: copy(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: copy(./../.): failed to open stream: %s in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [copy] ***
+
diff --git a/tests/security/open_basedir_copy_variation1.phpt b/tests/security/open_basedir_copy_variation1.phpt
new file mode 100644
index 0000000..899b31d
--- /dev/null
+++ b/tests/security/open_basedir_copy_variation1.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir_before("copy");
+
+var_dump(copy("../bad/bad.txt", "copy.txt"));
+var_dump(unlink("copy.txt"));
+
+test_open_basedir_after("copy");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [copy] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: unlink(copy.txt): No such file or directory in %s on line %d
+bool(false)
+*** Finished testing open_basedir configuration [copy] ***
+
diff --git a/tests/security/open_basedir_dir.phpt b/tests/security/open_basedir_dir.phpt
new file mode 100644
index 0000000..b1d6272
--- /dev/null
+++ b/tests/security/open_basedir_dir.phpt
@@ -0,0 +1,89 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+
+test_open_basedir_before("dir");
+test_open_basedir_error("dir");
+
+var_dump(dir($initdir."/test/ok/"));
+var_dump(dir($initdir."/test/ok"));
+var_dump(dir($initdir."/test/ok/../ok"));
+
+test_open_basedir_after("dir");?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [dir] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(../bad): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(../bad/bad.txt): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(..): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(../): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(/): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(../bad/.): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: dir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d
+bool(false)
+object(Directory)#%d (2) {
+ ["path"]=>
+ string(%d) "%s/test/ok/"
+ ["handle"]=>
+ resource(%d) of type (stream)
+}
+object(Directory)#%d (2) {
+ ["path"]=>
+ string(%d) "%s/test/ok"
+ ["handle"]=>
+ resource(%d) of type (stream)
+}
+object(Directory)#%d (2) {
+ ["path"]=>
+ string(%d) "%s/test/ok/../ok"
+ ["handle"]=>
+ resource(%d) of type (stream)
+}
+*** Finished testing open_basedir configuration [dir] ***
+
diff --git a/tests/security/open_basedir_disk_free_space.phpt b/tests/security/open_basedir_disk_free_space.phpt
new file mode 100644
index 0000000..365300a
--- /dev/null
+++ b/tests/security/open_basedir_disk_free_space.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("disk_free_space");
+test_open_basedir_error("disk_free_space");
+
+var_dump(disk_free_space($initdir."/test/ok"));
+test_open_basedir_after("disk_free_space");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [disk_free_space] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: disk_free_space(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+float(%s)
+*** Finished testing open_basedir configuration [disk_free_space] ***
diff --git a/tests/security/open_basedir_error_log.phpt b/tests/security/open_basedir_error_log.phpt
new file mode 100644
index 0000000..e89e190
--- /dev/null
+++ b/tests/security/open_basedir_error_log.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+error_log=
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("error_log");
+
+
+var_dump(ini_set("error_log", $initdir."/test/bad/bad.txt"));
+var_dump(ini_set("error_log", $initdir."/test/bad.txt"));
+var_dump(ini_set("error_log", $initdir."/bad.txt"));
+var_dump(ini_set("error_log", $initdir."/test/ok/ok.txt"));
+var_dump(ini_set("error_log", $initdir."/test/ok/ok.txt"));
+
+test_open_basedir_after("error_log");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [error_log] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: ini_set(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: ini_set(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+string(0) ""
+string(%d) "%s/test/ok/ok.txt"
+*** Finished testing open_basedir configuration [error_log] ***
+
diff --git a/tests/security/open_basedir_error_log_variation.phpt b/tests/security/open_basedir_error_log_variation.phpt
new file mode 100644
index 0000000..ab18266
--- /dev/null
+++ b/tests/security/open_basedir_error_log_variation.phpt
@@ -0,0 +1,49 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("error_log");
+
+define("DESTINATION_IS_FILE", 3);
+
+var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/bad/bad.txt"));
+var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/bad.txt"));
+var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/bad.txt"));
+var_dump(error_log("Hello World!", DESTINATION_IS_FILE, $initdir."/test/ok/ok.txt"));
+
+test_open_basedir_after("error_log");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [error_log] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: error_log(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: error_log(%s/test/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: error_log(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: error_log(%s/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+bool(true)
+*** Finished testing open_basedir configuration [error_log] ***
+
diff --git a/tests/security/open_basedir_file.phpt b/tests/security/open_basedir_file.phpt
new file mode 100644
index 0000000..ad222e8
--- /dev/null
+++ b/tests/security/open_basedir_file.phpt
@@ -0,0 +1,88 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("file");
+test_open_basedir_error("file");
+
+var_dump(file("ok.txt"));
+var_dump(file("../ok/ok.txt"));
+var_dump(file($initdir."/test/ok/ok.txt"));
+var_dump(file($initdir."/test/ok/../ok/ok.txt"));
+
+test_open_basedir_after("file");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [file] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(../bad): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(..): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(../): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(/): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(../bad/.): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file(%s/test/bad/../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+array(1) {
+ [0]=>
+ string(12) "Hello World!"
+}
+array(1) {
+ [0]=>
+ string(12) "Hello World!"
+}
+array(1) {
+ [0]=>
+ string(12) "Hello World!"
+}
+array(1) {
+ [0]=>
+ string(12) "Hello World!"
+}
+*** Finished testing open_basedir configuration [file] ***
+
diff --git a/tests/security/open_basedir_file_exists.phpt b/tests/security/open_basedir_file_exists.phpt
new file mode 100644
index 0000000..c249fc1
--- /dev/null
+++ b/tests/security/open_basedir_file_exists.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("file_exists");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [file_exists] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: file_exists(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: file_exists(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [file_exists] ***
+
diff --git a/tests/security/open_basedir_file_get_contents.phpt b/tests/security/open_basedir_file_get_contents.phpt
new file mode 100644
index 0000000..8ee5ddb
--- /dev/null
+++ b/tests/security/open_basedir_file_get_contents.phpt
@@ -0,0 +1,75 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("file_get_contents");
+test_open_basedir_error("file_get_contents");
+
+var_dump(file_get_contents("ok.txt"));
+var_dump(file_get_contents("../ok/ok.txt"));
+var_dump(file_get_contents($initdir."/test/ok/ok.txt"));
+var_dump(file_get_contents($initdir."/test/ok/../ok/ok.txt"));
+
+test_open_basedir_after("file_get_contents");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [file_get_contents] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(../bad): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(..): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(../): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(/): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(../bad/.): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_get_contents(%s/test/bad/../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+string(12) "Hello World!"
+string(12) "Hello World!"
+string(12) "Hello World!"
+string(12) "Hello World!"
+*** Finished testing open_basedir configuration [file_get_contents] ***
diff --git a/tests/security/open_basedir_file_put_contents.phpt b/tests/security/open_basedir_file_put_contents.phpt
new file mode 100644
index 0000000..0235c50
--- /dev/null
+++ b/tests/security/open_basedir_file_put_contents.phpt
@@ -0,0 +1,57 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("file_put_contents");
+
+var_dump(file_put_contents("../bad/bad.txt", "Hello World!"));
+var_dump(file_put_contents(".././bad/bad.txt", "Hello World!"));
+var_dump(file_put_contents("../bad/../bad/bad.txt", "Hello World!"));
+var_dump(file_put_contents("./.././bad/bad.txt", "Hello World!"));
+var_dump(file_put_contents($initdir."/test/bad/bad.txt", "Hello World!"));
+
+test_open_basedir_after("file_put_contents");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [file_put_contents] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_put_contents(../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_put_contents(.././bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_put_contents(../bad/../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_put_contents(./.././bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: file_put_contents(): open_basedir restriction in effect. File%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: file_put_contents%s/test/bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+*** Finished testing open_basedir configuration [file_put_contents] ***
+
diff --git a/tests/security/open_basedir_fileatime.phpt b/tests/security/open_basedir_fileatime.phpt
new file mode 100644
index 0000000..02cc94f
--- /dev/null
+++ b/tests/security/open_basedir_fileatime.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("fileatime");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [fileatime] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: fileatime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileatime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [fileatime] ***
+
diff --git a/tests/security/open_basedir_filectime.phpt b/tests/security/open_basedir_filectime.phpt
new file mode 100644
index 0000000..542c842
--- /dev/null
+++ b/tests/security/open_basedir_filectime.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("filectime");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [filectime] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: filectime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filectime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [filectime] ***
+
diff --git a/tests/security/open_basedir_filegroup.phpt b/tests/security/open_basedir_filegroup.phpt
new file mode 100644
index 0000000..5f6279a
--- /dev/null
+++ b/tests/security/open_basedir_filegroup.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("filegroup");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [filegroup] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: filegroup(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filegroup(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [filegroup] ***
+
diff --git a/tests/security/open_basedir_fileinode.phpt b/tests/security/open_basedir_fileinode.phpt
new file mode 100644
index 0000000..070c2c8
--- /dev/null
+++ b/tests/security/open_basedir_fileinode.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("fileinode");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [fileinode] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: fileinode(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileinode(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [fileinode] ***
+
diff --git a/tests/security/open_basedir_filemtime.phpt b/tests/security/open_basedir_filemtime.phpt
new file mode 100644
index 0000000..7213ddb
--- /dev/null
+++ b/tests/security/open_basedir_filemtime.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("filemtime");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [filemtime] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: filemtime(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filemtime(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [filemtime] ***
+
diff --git a/tests/security/open_basedir_fileowner.phpt b/tests/security/open_basedir_fileowner.phpt
new file mode 100644
index 0000000..b363b7e
--- /dev/null
+++ b/tests/security/open_basedir_fileowner.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("fileowner");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [fileowner] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: fileowner(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileowner(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [fileowner] ***
+
diff --git a/tests/security/open_basedir_fileperms.phpt b/tests/security/open_basedir_fileperms.phpt
new file mode 100644
index 0000000..a1e6511
--- /dev/null
+++ b/tests/security/open_basedir_fileperms.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("fileperms");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [fileperms] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: fileperms(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: fileperms(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [fileperms] ***
+
diff --git a/tests/security/open_basedir_filesize.phpt b/tests/security/open_basedir_filesize.phpt
new file mode 100644
index 0000000..a335dfd
--- /dev/null
+++ b/tests/security/open_basedir_filesize.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("filesize");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [filesize] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: filesize(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filesize(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+*** Finished testing open_basedir configuration [filesize] ***
+
diff --git a/tests/security/open_basedir_filetype.phpt b/tests/security/open_basedir_filetype.phpt
new file mode 100644
index 0000000..5091db5
--- /dev/null
+++ b/tests/security/open_basedir_filetype.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("filetype");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [filetype] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: filetype(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: filetype(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+string(3) "dir"
+string(4) "file"
+string(4) "file"
+string(4) "file"
+string(4) "file"
+*** Finished testing open_basedir configuration [filetype] ***
+
diff --git a/tests/security/open_basedir_fopen.phpt b/tests/security/open_basedir_fopen.phpt
new file mode 100644
index 0000000..3e236af
--- /dev/null
+++ b/tests/security/open_basedir_fopen.phpt
@@ -0,0 +1,86 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("fopen");
+
+var_dump(fopen("../bad", "r"));
+var_dump(fopen("../bad/bad.txt", "r"));
+var_dump(fopen("..", "r"));
+var_dump(fopen("../", "r"));
+var_dump(fopen("/", "r"));
+var_dump(fopen("../bad/.", "r"));
+var_dump(fopen("../bad/./bad.txt", "r"));
+var_dump(fopen("./../.", "r"));
+
+var_dump(fopen($initdir."/test/ok/ok.txt", "r"));
+var_dump(fopen("./ok.txt", "r"));
+var_dump(fopen("ok.txt", "r"));
+var_dump(fopen("../ok/ok.txt", "r"));
+var_dump(fopen("../ok/./ok.txt", "r"));
+
+test_open_basedir_after("fopen");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [fopen] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: fopen(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(../bad): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: fopen(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(../bad/bad.txt): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: fopen(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(..): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: fopen(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(../): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: fopen(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(/): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: fopen(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(../bad/.): failed to open stream: %s in %s on line %d
+bool(false)
+
+Warning: fopen(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(../bad/./bad.txt): failed to open stream: %s in %s on line 12
+bool(false)
+
+Warning: fopen(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: fopen(./../.): failed to open stream: %s in %s on line %d
+bool(false)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+*** Finished testing open_basedir configuration [fopen] ***
+
diff --git a/tests/security/open_basedir_glob.phpt b/tests/security/open_basedir_glob.phpt
new file mode 100644
index 0000000..602e48d
--- /dev/null
+++ b/tests/security/open_basedir_glob.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("glob");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [glob] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+array(1) {
+ [0]=>
+ string(5) "../ok"
+}
+array(1) {
+ [0]=>
+ string(6) "ok.txt"
+}
+array(1) {
+ [0]=>
+ string(12) "../ok/ok.txt"
+}
+array(1) {
+ [0]=>
+ string(%d) "%s/test/ok/ok.txt"
+}
+array(1) {
+ [0]=>
+ string(%d) "%s/test/ok/../ok/ok.txt"
+}
+*** Finished testing open_basedir configuration [glob] ***
+
diff --git a/tests/security/open_basedir_glob_variation.phpt b/tests/security/open_basedir_glob_variation.phpt
new file mode 100644
index 0000000..52c354f
--- /dev/null
+++ b/tests/security/open_basedir_glob_variation.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Test open_basedir configuration for glob
+--INI--
+open_basedir=.
+--FILE--
+<?php
+$dir = "globtest1";
+$dir2 = "globtest2";
+mkdir($dir);
+mkdir($dir2);
+chdir($dir);
+var_dump(glob("../globtest*"));
+?>
+--CLEAN--
+<?php
+$dir = "globtest1";
+$dir2 = "globtest2";
+rmdir($dir);
+rmdir($dir2);
+?>
+--EXPECT--
+array(1) {
+ [0]=>
+ string(12) "../globtest1"
+}
+
diff --git a/tests/security/open_basedir_is_dir.phpt b/tests/security/open_basedir_is_dir.phpt
new file mode 100644
index 0000000..e4ad620
--- /dev/null
+++ b/tests/security/open_basedir_is_dir.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("is_dir");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [is_dir] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: is_dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_dir(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+*** Finished testing open_basedir configuration [is_dir] ***
+
diff --git a/tests/security/open_basedir_is_executable.phpt b/tests/security/open_basedir_is_executable.phpt
new file mode 100644
index 0000000..375d427
--- /dev/null
+++ b/tests/security/open_basedir_is_executable.phpt
@@ -0,0 +1,59 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("is_executable");
+test_open_basedir_error("is_executable");
+
+var_dump(is_executable("ok.txt"));
+var_dump(is_executable("../ok/ok.txt"));
+var_dump(is_executable($initdir."/test/ok/ok.txt"));
+var_dump(is_executable($initdir."/test/ok/../ok/ok.txt"));
+
+test_open_basedir_after("is_executable");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [is_executable] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: is_executable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_executable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_executable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_executable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_executable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_executable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_executable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+*** Finished testing open_basedir configuration [is_executable] ***
diff --git a/tests/security/open_basedir_is_file.phpt b/tests/security/open_basedir_is_file.phpt
new file mode 100644
index 0000000..51ef0a2
--- /dev/null
+++ b/tests/security/open_basedir_is_file.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("is_file");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [is_file] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: is_file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_file(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [is_file] ***
+
diff --git a/tests/security/open_basedir_is_link.phpt b/tests/security/open_basedir_is_link.phpt
new file mode 100644
index 0000000..5d12148
--- /dev/null
+++ b/tests/security/open_basedir_is_link.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("is_link");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [is_link] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: is_link(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_link(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+*** Finished testing open_basedir configuration [is_link] ***
+
diff --git a/tests/security/open_basedir_is_readable.phpt b/tests/security/open_basedir_is_readable.phpt
new file mode 100644
index 0000000..951a19a
--- /dev/null
+++ b/tests/security/open_basedir_is_readable.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("is_readable");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [is_readable] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: is_readable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_readable(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [is_readable] ***
+
diff --git a/tests/security/open_basedir_is_writable.phpt b/tests/security/open_basedir_is_writable.phpt
new file mode 100644
index 0000000..25ce1c6
--- /dev/null
+++ b/tests/security/open_basedir_is_writable.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("is_writable");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [is_writable] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: is_writable(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: is_writable(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [is_writable] ***
+
diff --git a/tests/security/open_basedir_link.phpt b/tests/security/open_basedir_link.phpt
new file mode 100644
index 0000000..82f97d6
--- /dev/null
+++ b/tests/security/open_basedir_link.phpt
@@ -0,0 +1,78 @@
+--TEST--
+Test open_basedir configuration
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip no links on Windows');
+}
+?>
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("link");
+
+$target = ($initdir."/test/ok/ok.txt");
+var_dump(link($target, "../bad/link.txt"));
+var_dump(link($target, "../link.txt"));
+var_dump(link($target, "../bad/./link.txt"));
+var_dump(link($target, "./.././link.txt"));
+
+$link = ($initdir."/test/ok/link.txt");
+var_dump(link("../bad/bad.txt", $link));
+var_dump(link("../bad", $link));
+var_dump(link("../bad/./bad.txt", $link));
+var_dump(link("../bad/bad.txt", $link));
+var_dump(link("./.././bad", $link));
+
+$target = ($initdir."/test/ok/ok.txt");
+
+var_dump(link($target, $link));
+var_dump(unlink($link));
+test_open_basedir_after("link");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [link] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/bad/link.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/link.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/bad/link.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/link.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: link(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [link] ***
+
diff --git a/tests/security/open_basedir_linkinfo.phpt b/tests/security/open_basedir_linkinfo.phpt
new file mode 100644
index 0000000..f8be453
--- /dev/null
+++ b/tests/security/open_basedir_linkinfo.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Test open_basedir configuration
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip no symlinks on Windows');
+}
+?>
+--XFAIL--
+BUG: open_basedir cannot delete symlink to prohibited file. See also
+bugs 48111 and 52176.
+--FILE--
+<?php
+chdir(__DIR__);
+ini_set("open_basedir", ".");
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("linkinfo", FALSE);
+
+chdir($initdir);
+
+$target = ($initdir."/test/bad/bad.txt");
+$symlink = ($initdir."/test/ok/symlink.txt");
+var_dump(symlink($target, $symlink));
+
+chdir($initdir."/test/ok");
+
+var_dump(linkinfo("symlink.txt"));
+var_dump(linkinfo("../ok/symlink.txt"));
+var_dump(linkinfo("../ok/./symlink.txt"));
+var_dump(linkinfo("./symlink.txt"));
+var_dump(linkinfo($initdir."/test/ok/symlink.txt"));
+
+$target = ($initdir."/test/ok/ok.txt");
+$symlink = ($initdir."/test/ok/symlink.txt");
+var_dump(symlink($target, $symlink));
+var_dump(linkinfo($symlink));
+var_dump(unlink($symlink));
+
+test_open_basedir_after("linkinfo");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [linkinfo] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+int(%d)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+int(%d)
+bool(true)
+*** Finished testing open_basedir configuration [linkinfo] ***
+
diff --git a/tests/security/open_basedir_lstat.phpt b/tests/security/open_basedir_lstat.phpt
new file mode 100644
index 0000000..35e5a22
--- /dev/null
+++ b/tests/security/open_basedir_lstat.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir_array("lstat");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [lstat] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: lstat(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: lstat(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [lstat] ***
+
diff --git a/tests/security/open_basedir_mkdir.phpt b/tests/security/open_basedir_mkdir.phpt
new file mode 100644
index 0000000..9c32d40
--- /dev/null
+++ b/tests/security/open_basedir_mkdir.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Test open_basedir configuration
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip Windows only variation');
+}
+?>
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("mkdir");
+
+var_dump(mkdir("../bad/blah"));
+var_dump(mkdir("../blah"));
+var_dump(mkdir("../bad/./blah"));
+var_dump(mkdir("./.././blah"));
+
+var_dump(mkdir($initdir."/test/ok/blah"));
+var_dump(rmdir($initdir."/test/ok/blah"));
+test_open_basedir_after("mkdir");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [mkdir] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: mkdir(): open_basedir restriction in effect. File(../bad/blah) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: mkdir(): open_basedir restriction in effect. File(../blah) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: mkdir(): open_basedir restriction in effect. File(../bad/./blah) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: mkdir(): open_basedir restriction in effect. File(./.././blah) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [mkdir] ***
diff --git a/tests/security/open_basedir_opendir.phpt b/tests/security/open_basedir_opendir.phpt
new file mode 100644
index 0000000..774b853
--- /dev/null
+++ b/tests/security/open_basedir_opendir.phpt
@@ -0,0 +1,73 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("opendir");
+test_open_basedir_error("opendir");
+
+var_dump(opendir($initdir."/test/ok/"));
+var_dump(opendir($initdir."/test/ok"));
+var_dump(opendir($initdir."/test/ok/../ok"));
+
+test_open_basedir_after("opendir");?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [opendir] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: opendir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(../bad): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(../bad/bad.txt): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(..): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(../): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(/): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(../bad/.): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d
+bool(false)
+
+Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: opendir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d
+bool(false)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+resource(%d) of type (stream)
+*** Finished testing open_basedir configuration [opendir] ***
+
diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt
new file mode 100644
index 0000000..d69adeb
--- /dev/null
+++ b/tests/security/open_basedir_parse_ini_file.phpt
@@ -0,0 +1,75 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip Windows only variation');
+}
+?>
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir_before("parse_ini_file");
+$directory = dirname(__FILE__);
+
+var_dump(parse_ini_file("../bad"));
+var_dump(parse_ini_file("../bad/bad.txt"));
+var_dump(parse_ini_file(".."));
+var_dump(parse_ini_file("../"));
+var_dump(parse_ini_file("../bad/."));
+var_dump(parse_ini_file("../bad/./bad.txt"));
+var_dump(parse_ini_file("./../."));
+
+test_open_basedir_after("parse_ini_file");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [parse_ini_file] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 6
+
+Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6
+bool(false)
+
+Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 7
+
+Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 7
+bool(false)
+
+Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 8
+
+Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8
+bool(false)
+
+Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 9
+
+Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9
+bool(false)
+
+Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 10
+
+Warning: parse_ini_file(%stest\bad): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10
+bool(false)
+
+Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 11
+
+Warning: parse_ini_file(%stest\bad\bad.txt): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 11
+bool(false)
+
+Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 12
+
+Warning: parse_ini_file(%stest): failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12
+bool(false)
+*** Finished testing open_basedir configuration [parse_ini_file] ***
+
diff --git a/tests/security/open_basedir_readlink.phpt b/tests/security/open_basedir_readlink.phpt
new file mode 100644
index 0000000..b102ee9
--- /dev/null
+++ b/tests/security/open_basedir_readlink.phpt
@@ -0,0 +1,72 @@
+--TEST--
+Test open_basedir configuration
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip no symlinks on Windows');
+}
+?>
+--FILE--
+<?php
+chdir(__DIR__);
+ini_set("open_basedir", ".");
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("readlink", FALSE);
+
+chdir($initdir);
+
+$target = ($initdir."/test/bad/bad.txt");
+$symlink = ($initdir."/test/ok/symlink.txt");
+var_dump(symlink($target, $symlink));
+
+chdir($initdir."/test/ok");
+
+var_dump(readlink("symlink.txt"));
+var_dump(readlink("../ok/symlink.txt"));
+var_dump(readlink("../ok/./symlink.txt"));
+var_dump(readlink("./symlink.txt"));
+var_dump(readlink($initdir."/test/ok/symlink.txt"));
+
+$target = ($initdir."/test/ok/ok.txt");
+$symlink = ($initdir."/test/ok/symlink.txt");
+var_dump(symlink($target, $symlink));
+var_dump(readlink($symlink));
+
+test_open_basedir_after("readlink");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [readlink] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: readlink(): open_basedir restriction in effect. File(symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: readlink(): open_basedir restriction in effect. File(../ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: readlink(): open_basedir restriction in effect. File(../ok/./symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: readlink(): open_basedir restriction in effect. File(./symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: readlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: readlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+*** Finished testing open_basedir configuration [readlink] ***
+
diff --git a/tests/security/open_basedir_realpath.phpt b/tests/security/open_basedir_realpath.phpt
new file mode 100644
index 0000000..8cae890
--- /dev/null
+++ b/tests/security/open_basedir_realpath.phpt
@@ -0,0 +1,61 @@
+--TEST--
+Test open_basedir configuration
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip only run on Windows');
+}
+?>
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir("realpath");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [realpath] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test\bad\bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: realpath(): open_basedir restriction in effect. File(%s\test) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+string(%d) "%s\test\ok"
+string(%d) "%s\test\ok\ok.txt"
+string(%d) "%s\test\ok\ok.txt"
+string(%d) "%s\test\ok\ok.txt"
+string(%d) "%s\test\ok\ok.txt"
+*** Finished testing open_basedir configuration [realpath] ***
+
diff --git a/tests/security/open_basedir_rename.phpt b/tests/security/open_basedir_rename.phpt
new file mode 100644
index 0000000..2747093
--- /dev/null
+++ b/tests/security/open_basedir_rename.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("rename");
+
+var_dump(rename("../bad/bad.txt", "rename.txt"));
+var_dump(rename(".././bad/bad.txt", "rename.txt"));
+var_dump(rename("../bad/../bad/bad.txt", "rename.txt"));
+var_dump(rename("./.././bad/bad.txt", "rename.txt"));
+var_dump(rename($initdir."/test/bad/bad.txt", "rename.txt"));
+
+test_open_basedir_after("rename");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [rename] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: rename(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rename(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rename(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rename(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rename(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+*** Finished testing open_basedir configuration [rename] ***
+
diff --git a/tests/security/open_basedir_rmdir.phpt b/tests/security/open_basedir_rmdir.phpt
new file mode 100644
index 0000000..c1d4b6b
--- /dev/null
+++ b/tests/security/open_basedir_rmdir.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("rmdir");
+
+var_dump(rmdir("../bad"));
+var_dump(rmdir(".././bad"));
+var_dump(rmdir("../bad/../bad"));
+var_dump(rmdir("./.././bad"));
+var_dump(rmdir($initdir."/test/bad"));
+
+test_open_basedir_after("rmdir");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [rmdir] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: rmdir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rmdir(): open_basedir restriction in effect. File(.././bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rmdir(): open_basedir restriction in effect. File(../bad/../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rmdir(): open_basedir restriction in effect. File(./.././bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: rmdir(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+*** Finished testing open_basedir configuration [rmdir] ***
+
diff --git a/tests/security/open_basedir_scandir.phpt b/tests/security/open_basedir_scandir.phpt
new file mode 100644
index 0000000..caffaa1
--- /dev/null
+++ b/tests/security/open_basedir_scandir.phpt
@@ -0,0 +1,110 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("scandir");
+test_open_basedir_error("scandir");
+
+var_dump(scandir($initdir."/test/ok/"));
+var_dump(scandir($initdir."/test/ok"));
+var_dump(scandir($initdir."/test/ok/../ok"));
+
+test_open_basedir_after("scandir");?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [scandir] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: scandir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(../bad): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+
+Warning: scandir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(../bad/bad.txt): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+
+Warning: scandir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(..): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+
+Warning: scandir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(../): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+
+Warning: scandir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(/): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+
+Warning: scandir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(../bad/.): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+
+Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(%s/test/bad/bad.txt): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+
+Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+
+Warning: scandir(%s/test/bad/../bad/bad.txt): failed to open dir: %s in %s on line %d
+
+Warning: scandir(): (errno 1): %s in %s on line %d
+bool(false)
+array(3) {
+ [0]=>
+ string(1) "."
+ [1]=>
+ string(2) ".."
+ [2]=>
+ string(6) "ok.txt"
+}
+array(3) {
+ [0]=>
+ string(1) "."
+ [1]=>
+ string(2) ".."
+ [2]=>
+ string(6) "ok.txt"
+}
+array(3) {
+ [0]=>
+ string(1) "."
+ [1]=>
+ string(2) ".."
+ [2]=>
+ string(6) "ok.txt"
+}
+*** Finished testing open_basedir configuration [scandir] ***
+
diff --git a/tests/security/open_basedir_stat.phpt b/tests/security/open_basedir_stat.phpt
new file mode 100644
index 0000000..b80b854
--- /dev/null
+++ b/tests/security/open_basedir_stat.phpt
@@ -0,0 +1,55 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+test_open_basedir_array("stat");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [stat] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: stat(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: stat(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [stat] ***
+
diff --git a/tests/security/open_basedir_symlink.phpt b/tests/security/open_basedir_symlink.phpt
new file mode 100644
index 0000000..cdc8e7b
--- /dev/null
+++ b/tests/security/open_basedir_symlink.phpt
@@ -0,0 +1,87 @@
+--TEST--
+Test open_basedir configuration
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip no symlinks on Windows');
+}
+?>
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("symlink");
+
+$target = ($initdir."/test/ok/ok.txt");
+var_dump(symlink($target, "../bad/symlink.txt"));
+var_dump(symlink($target, "../symlink.txt"));
+var_dump(symlink($target, "../bad/./symlink.txt"));
+var_dump(symlink($target, "./.././symlink.txt"));
+
+$symlink = ($initdir."/test/ok/symlink.txt");
+var_dump(symlink("../bad/bad.txt", $symlink));
+var_dump(symlink("../bad", $symlink));
+var_dump(symlink("../bad/./bad.txt", $symlink));
+var_dump(symlink("../bad/bad.txt", $symlink));
+var_dump(symlink("./.././bad", $symlink));
+
+$target = ($initdir."/test/ok/ok.txt");
+
+var_dump(symlink($target, $symlink));
+var_dump(unlink($symlink));
+
+var_dump(mkdir("ok2"));
+$symlink = ($initdir."/test/ok/ok2/ok.txt");
+var_dump(symlink("../ok.txt", $symlink)); // $target == (dirname($symlink)."/".$target) == ($initdir."/test/ok/ok.txt");
+var_dump(unlink($symlink));
+
+test_open_basedir_after("symlink");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [symlink] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/symlink.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [symlink] ***
+
diff --git a/tests/security/open_basedir_tempnam.phpt b/tests/security/open_basedir_tempnam.phpt
new file mode 100644
index 0000000..fd63e29
--- /dev/null
+++ b/tests/security/open_basedir_tempnam.phpt
@@ -0,0 +1,75 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("tempnam");
+
+var_dump(tempnam("../bad", "test"));
+var_dump(tempnam("..", "test"));
+var_dump(tempnam("../", "test"));
+var_dump(tempnam("/", "test"));
+var_dump(tempnam("../bad/.", "test"));
+var_dump(tempnam("./../.", "test"));
+var_dump(tempnam("", "test"));
+
+//absolute test
+$file = tempnam($initdir."/test/ok", "test");
+var_dump($file);
+var_dump(unlink($file));
+
+//relative test
+$file = tempnam(".", "test");
+var_dump($file);
+var_dump(unlink($file));
+
+$file = tempnam("../ok", "test");
+var_dump($file);
+var_dump(unlink($file));
+
+test_open_basedir_after("tempnam");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [tempnam] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: tempnam(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: tempnam(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: tempnam(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: tempnam(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: tempnam(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: tempnam(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: tempnam(): open_basedir restriction in effect. File() is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+string(%d) "%s"
+bool(true)
+string(%d) "%s"
+bool(true)
+string(%d) "%s"
+bool(true)
+*** Finished testing open_basedir configuration [tempnam] ***
+
diff --git a/tests/security/open_basedir_touch.phpt b/tests/security/open_basedir_touch.phpt
new file mode 100644
index 0000000..3a8aee8
--- /dev/null
+++ b/tests/security/open_basedir_touch.phpt
@@ -0,0 +1,70 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("touch");
+
+var_dump(touch("../bad"));
+var_dump(touch("../bad/bad.txt"));
+var_dump(touch(".."));
+var_dump(touch("../"));
+var_dump(touch("/"));
+var_dump(touch("../bad/."));
+var_dump(touch("../bad/./bad.txt"));
+var_dump(touch("./../."));
+
+var_dump(touch($initdir."/test/ok/ok.txt"));
+var_dump(touch("./ok.txt"));
+var_dump(touch("ok.txt"));
+var_dump(touch("../ok/ok.txt"));
+var_dump(touch("../ok/./ok.txt"));
+
+test_open_basedir_after("touch");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [touch] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: touch(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: touch(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: touch(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: touch(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: touch(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: touch(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: touch(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: touch(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+*** Finished testing open_basedir configuration [touch] ***
+
diff --git a/tests/security/open_basedir_unlink.phpt b/tests/security/open_basedir_unlink.phpt
new file mode 100644
index 0000000..aeedac9
--- /dev/null
+++ b/tests/security/open_basedir_unlink.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Test open_basedir configuration
+--INI--
+open_basedir=.
+--FILE--
+<?php
+require_once "open_basedir.inc";
+$initdir = getcwd();
+test_open_basedir_before("unlink");
+
+var_dump(unlink("../bad/bad.txt"));
+var_dump(unlink(".././bad/bad.txt"));
+var_dump(unlink("../bad/../bad/bad.txt"));
+var_dump(unlink("./.././bad/bad.txt"));
+var_dump(unlink($initdir."/test/bad/bad.txt"));
+
+test_open_basedir_after("unlink");
+?>
+--CLEAN--
+<?php
+require_once "open_basedir.inc";
+delete_directories();
+?>
+--EXPECTF--
+*** Testing open_basedir configuration [unlink] ***
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+
+Warning: unlink(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: unlink(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: unlink(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: unlink(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+
+Warning: unlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d
+bool(false)
+*** Finished testing open_basedir configuration [unlink] ***
+
diff --git a/tests/strings/001.phpt b/tests/strings/001.phpt
new file mode 100644
index 0000000..3bfd3db
--- /dev/null
+++ b/tests/strings/001.phpt
@@ -0,0 +1,210 @@
+--TEST--
+String functions
+--FILE--
+<?php
+
+error_reporting(0);
+
+echo "Testing strtok: ";
+
+$str = "testing 1/2\\3";
+$tok1 = strtok($str, " ");
+$tok2 = strtok("/");
+$tok3 = strtok("\\");
+$tok4 = strtok(".");
+if ($tok1 != "testing") {
+ echo("failed 1\n");
+} elseif ($tok2 != "1") {
+ echo("failed 2\n");
+} elseif ($tok3 != "2") {
+ echo("failed 3\n");
+} elseif ($tok4 != "3") {
+ echo("failed 4\n");
+} else {
+ echo("passed\n");
+}
+
+echo "Testing strstr: ";
+$test = "This is a test";
+$found1 = strstr($test, 32);
+$found2 = strstr($test, "a ");
+if ($found1 != " is a test") {
+ echo("failed 1\n");
+} elseif ($found2 != "a test") {
+ echo("failed 2\n");
+} else {
+ echo("passed\n");
+}
+
+echo "Testing strrchr: ";
+$test = "fola fola blakken";
+$found1 = strrchr($test, "b");
+$found2 = strrchr($test, 102);
+if ($found1 != "blakken") {
+ echo("failed 1\n");
+} elseif ($found2 != "fola blakken") {
+ echo("failed 2\n");
+}
+else {
+ echo("passed\n");
+}
+
+echo "Testing strtoupper: ";
+$test = "abCdEfg";
+$upper = strtoupper($test);
+if ($upper == "ABCDEFG") {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing strtolower: ";
+$test = "ABcDeFG";
+$lower = strtolower($test);
+if ($lower == "abcdefg") {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing substr: ";
+$tests = $ok = 0;
+$string = "string12345";
+$tests++; if (substr($string, 2, 10) == "ring12345") { $ok++; }
+$tests++; if (substr($string, 4, 7) == "ng12345") { $ok++; }
+$tests++; if (substr($string, 4) == "ng12345") { $ok++; }
+$tests++; if (substr($string, 10, 2) == "5") { $ok++; }
+$tests++; if (substr($string, 6, 0) == "") { $ok++; }
+$tests++; if (substr($string, -2, 2) == "45") { $ok++; }
+$tests++; if (substr($string, 1, -1) == "tring1234") { $ok++; }
+$tests++; if (substr($string, -1, -2) == "") { $ok++; }
+$tests++; if (substr($string, -3, -2) == "3") { $ok++; }
+
+if ($tests == $ok) {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+$raw = ' !"#$%&\'()*+,-./0123456789:;<=>?'
+ . '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'
+ . '`abcdefghijklmnopqrstuvwxyz{|}~'
+ . "\0";
+
+echo "Testing rawurlencode: ";
+$encoded = rawurlencode($raw);
+$correct = '%20%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F'
+ . '%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_'
+ . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~'
+ . '%00';
+if ($encoded == $correct) {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing rawurldecode: ";
+$decoded = rawurldecode($correct);
+if ($decoded == $raw) {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing urlencode: ";
+$encoded = urlencode($raw);
+$correct = '+%21%22%23%24%25%26%27%28%29%2A%2B%2C-.%2F0123456789%3A%3B%3C%3D%3E%3F'
+ . '%40ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_'
+ . '%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E'
+ . '%00';
+if ($encoded == $correct) {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing urldecode: ";
+$decoded = urldecode($correct);
+if ($decoded == $raw) {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing quotemeta: ";
+$raw = "a.\\+*?" . chr(91) . "^" . chr(93) . "b\$c";
+$quoted = quotemeta($raw);
+if ($quoted == "a\\.\\\\\\+\\*\\?\\[\\^\\]b\\\$c") {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing ufirst: ";
+$str = "fahrvergnuegen";
+$uc = ucfirst($str);
+if ($uc == "Fahrvergnuegen") {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing strtr: ";
+$str = "test abcdefgh";
+$tr = strtr($str, "def", "456");
+if ($tr == "t5st abc456gh") {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing addslashes: ";
+$str = "\"\\'";
+$as = addslashes($str);
+if ($as == "\\\"\\\\\\'") {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+echo "Testing stripslashes: ";
+$str = "\$\\'";
+$ss = stripslashes($str);
+if ($ss == "\$'") {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+
+echo "Testing uniqid: ";
+$str = "prefix";
+$ui1 = uniqid($str);
+$ui2 = uniqid($str);
+
+$len = strncasecmp(PHP_OS, 'CYGWIN', 6) ? 19 : 29;
+
+if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $len && $ui1 != $ui2) {
+ echo("passed\n");
+} else {
+ echo("failed!\n");
+}
+
+?>
+--EXPECT--
+Testing strtok: passed
+Testing strstr: passed
+Testing strrchr: passed
+Testing strtoupper: passed
+Testing strtolower: passed
+Testing substr: passed
+Testing rawurlencode: passed
+Testing rawurldecode: passed
+Testing urlencode: passed
+Testing urldecode: passed
+Testing quotemeta: passed
+Testing ufirst: passed
+Testing strtr: passed
+Testing addslashes: passed
+Testing stripslashes: passed
+Testing uniqid: passed
diff --git a/tests/strings/002.phpt b/tests/strings/002.phpt
new file mode 100644
index 0000000..7b95a25
--- /dev/null
+++ b/tests/strings/002.phpt
@@ -0,0 +1,83 @@
+--TEST--
+Formatted print functions
+--FILE--
+<?php
+error_reporting(0);
+
+$fp = fopen("php://stdout", "w") or die("Arrggsgg!!");
+$x = fprintf($fp, "fprintf test 1:%.5s", "abcdefghij");
+echo "\n";
+var_dump($x);
+
+printf("printf test 1:%s\n", "simple string");
+printf("printf test 2:%d\n", 42);
+printf("printf test 3:%f\n", 10.0/3);
+printf("printf test 4:%.10f\n", 10.0/3);
+printf("printf test 5:%-10.2f\n", 2.5);
+printf("printf test 6:%-010.2f\n", 2.5);
+printf("printf test 7:%010.2f\n", 2.5);
+printf("printf test 8:<%20s>\n", "foo");
+printf("printf test 9:<%-20s>\n", "bar");
+printf("printf test 10: 123456789012345\n");
+printf("printf test 10:<%15s>\n", "høyesterettsjustitiarius");
+printf("printf test 11: 123456789012345678901234567890\n");
+printf("printf test 11:<%30s>\n", "høyesterettsjustitiarius");
+printf("printf test 12:%5.2f\n", -12.34);
+printf("printf test 13:%5d\n", -12);
+printf("printf test 14:%c\n", 64);
+printf("printf test 15:%b\n", 170);
+printf("printf test 16:%x\n", 170);
+printf("printf test 17:%X\n", 170);
+printf("printf test 18:%16b\n", 170);
+printf("printf test 19:%16x\n", 170);
+printf("printf test 20:%16X\n", 170);
+printf("printf test 21:%016b\n", 170);
+printf("printf test 22:%016x\n", 170);
+printf("printf test 23:%016X\n", 170);
+printf("printf test 24:%.5s\n", "abcdefghij");
+printf("printf test 25:%-2s\n", "gazonk");
+printf("printf test 26:%2\$d %1\$d\n", 1, 2);
+printf("printf test 27:%3\$d %d %d\n", 1, 2, 3);
+printf("printf test 28:%2\$02d %1\$2d\n", 1, 2);
+printf("printf test 29:%2\$-2d %1\$2d\n", 1, 2);
+print("printf test 30:"); printf("%0\$s", 1); print("x\n");
+vprintf("vprintf test 1:%2\$-2d %1\$2d\n", array(1, 2));
+
+
+?>
+--EXPECT--
+fprintf test 1:abcde
+int(20)
+printf test 1:simple string
+printf test 2:42
+printf test 3:3.333333
+printf test 4:3.3333333333
+printf test 5:2.50
+printf test 6:2.50000000
+printf test 7:0000002.50
+printf test 8:< foo>
+printf test 9:<bar >
+printf test 10: 123456789012345
+printf test 10:<høyesterettsjustitiarius>
+printf test 11: 123456789012345678901234567890
+printf test 11:< høyesterettsjustitiarius>
+printf test 12:-12.34
+printf test 13: -12
+printf test 14:@
+printf test 15:10101010
+printf test 16:aa
+printf test 17:AA
+printf test 18: 10101010
+printf test 19: aa
+printf test 20: AA
+printf test 21:0000000010101010
+printf test 22:00000000000000aa
+printf test 23:00000000000000AA
+printf test 24:abcde
+printf test 25:gazonk
+printf test 26:2 1
+printf test 27:3 1 2
+printf test 28:02 1
+printf test 29:2 1
+printf test 30:x
+vprintf test 1:2 1
diff --git a/tests/strings/004.phpt b/tests/strings/004.phpt
new file mode 100644
index 0000000..7bcb452
--- /dev/null
+++ b/tests/strings/004.phpt
@@ -0,0 +1,21 @@
+--TEST--
+highlight_string() buffering
+--INI--
+highlight.string=#DD0000
+highlight.comment=#FF9900
+highlight.keyword=#007700
+highlight.default=#0000BB
+highlight.html=#000000
+--FILE--
+<?php
+$var = highlight_string("<br /><?php echo \"foo\"; ?><br />");
+$var = highlight_string("<br /><?php echo \"bar\"; ?><br />", TRUE);
+echo "\n[$var]\n";
+?>
+--EXPECT--
+<code><span style="color: #000000">
+&lt;br&nbsp;/&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"foo"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;br&nbsp;/&gt;</span>
+</code>
+[<code><span style="color: #000000">
+&lt;br&nbsp;/&gt;<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"bar"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span>&lt;br&nbsp;/&gt;</span>
+</code>]
diff --git a/tests/strings/bug22592.phpt b/tests/strings/bug22592.phpt
new file mode 100644
index 0000000..3443c32
--- /dev/null
+++ b/tests/strings/bug22592.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #22592 (Cascading assignments to strings with curly braces broken)
+--FILE--
+<?php
+$wrong = $correct = 'abcdef';
+
+$t = $x[] = 'x';
+
+var_dump($correct);
+var_dump($wrong);
+
+$correct[1] = '*';
+$correct[3] = '*';
+$correct[5] = '*';
+
+// This produces the
+$wrong[1] = $wrong[3] = $wrong[5] = '*';
+
+var_dump($correct);
+var_dump($wrong);
+
+?>
+--EXPECT--
+string(6) "abcdef"
+string(6) "abcdef"
+string(6) "a*c*e*"
+string(6) "a*c*e*"
diff --git a/tests/strings/bug26703.phpt b/tests/strings/bug26703.phpt
new file mode 100644
index 0000000..bea8fb1
--- /dev/null
+++ b/tests/strings/bug26703.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #26703 (Certain characters inside strings incorrectly treated as keywords)
+--INI--
+highlight.string=#DD0000
+highlight.comment=#FF9900
+highlight.keyword=#007700
+highlight.default=#0000BB
+highlight.html=#000000
+--FILE--
+<?php
+ highlight_string('<?php echo "foo[] $a \n"; ?>');
+?>
+--EXPECT--
+<code><span style="color: #000000">
+<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"foo[]&nbsp;</span><span style="color: #0000BB">$a</span><span style="color: #DD0000">&nbsp;\n"</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span>
+</span>
+</code>
diff --git a/tests/strings/offsets_chaining_1.phpt b/tests/strings/offsets_chaining_1.phpt
new file mode 100644
index 0000000..eecdfb9
--- /dev/null
+++ b/tests/strings/offsets_chaining_1.phpt
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0][0][0][0]);
+?>
+--EXPECTF--
+string(1) "f"
+
diff --git a/tests/strings/offsets_chaining_2.phpt b/tests/strings/offsets_chaining_2.phpt
new file mode 100644
index 0000000..07f67f0
--- /dev/null
+++ b/tests/strings/offsets_chaining_2.phpt
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string{0}{0}[0][0]);
+?>
+--EXPECTF--
+string(1) "f"
+
diff --git a/tests/strings/offsets_chaining_3.phpt b/tests/strings/offsets_chaining_3.phpt
new file mode 100644
index 0000000..23b8e70
--- /dev/null
+++ b/tests/strings/offsets_chaining_3.phpt
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string[0][0][0][0]));
+?>
+--EXPECTF--
+bool(true)
+
diff --git a/tests/strings/offsets_chaining_4.phpt b/tests/strings/offsets_chaining_4.phpt
new file mode 100644
index 0000000..79b95c1
--- /dev/null
+++ b/tests/strings/offsets_chaining_4.phpt
@@ -0,0 +1,12 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump(isset($string{0}{0}[0][0]));
+?>
+--EXPECTF--
+bool(true)
+
diff --git a/tests/strings/offsets_chaining_5.phpt b/tests/strings/offsets_chaining_5.phpt
new file mode 100644
index 0000000..efcf2f3
--- /dev/null
+++ b/tests/strings/offsets_chaining_5.phpt
@@ -0,0 +1,27 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$array = array('expected_array' => "foobar");
+var_dump(isset($array['expected_array']));
+var_dump($array['expected_array']);
+var_dump(isset($array['expected_array']['foo']));
+var_dump($array['expected_array']['foo']);
+var_dump(isset($array['expected_array']['foo']['bar']));
+var_dump($array['expected_array']['foo']['bar']);
+?>
+--EXPECTF--
+bool(true)
+string(6) "foobar"
+bool(false)
+
+Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
+string(1) "f"
+bool(false)
+
+Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d
+
+Warning: Illegal string offset 'bar' in %soffsets_chaining_5.php on line %d
+string(1) "f"
diff --git a/tests/strings/offsets_general.phpt b/tests/strings/offsets_general.phpt
new file mode 100644
index 0000000..9d69ea2
--- /dev/null
+++ b/tests/strings/offsets_general.phpt
@@ -0,0 +1,38 @@
+--TEST--
+testing the behavior of string offsets
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+<?php
+$string = "foobar";
+var_dump($string[0]);
+var_dump($string[1]);
+var_dump(isset($string[0]));
+var_dump(isset($string[0][0]));
+var_dump($string["foo"]);
+var_dump(isset($string["foo"]["bar"]));
+var_dump($string{0});
+var_dump($string{1});
+var_dump(isset($string{0}));
+var_dump(isset($string{0}{0}));
+var_dump($string{"foo"});
+var_dump(isset($string{"foo"}{"bar"}));
+?>
+--EXPECTF--
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(true)
+
+Warning: Illegal string offset 'foo' in %s line %d
+string(1) "f"
+bool(false)
+string(1) "f"
+string(1) "o"
+bool(true)
+bool(true)
+
+Warning: Illegal string offset 'foo' in %s line %d
+string(1) "f"
+bool(false)
+